Developers » API methods » Auth » auth.restore
API methodsauth.restore
Allows to restore account access using a code received via SMS.

This method is only available for apps with Direct authorization access.
This method can be called by a service token. Only public data is returned.
This method can be called with a user token.
phoneUser's phone number.
string, required parameter
last_nameUser's last name.
string, required parameter
In case of success the method returns an object containing following fields:
  • success 1;
  • sid parameter required to get access by code.

To finish the restoration refer to the following address:{Application ID}&client_secret={Secret key}&username={Phone number}&scope={Permissions list}&sid={Parameter received with this method}&code={Received SMS code}

Parameters list:
  • grant_type requires to send the value: restore_code;
  • client_id application ID;
  • client_secret app's secret key;
  • username phone number used for restoration;
  • scope list of permissions separated with commas;
  • sid session ID received after running this method;
  • code received SMS code.

While authorizing through restore_code OAuth will return the same data as usual authorization with an extra change_password_hash parameter required for account.changePassword method.
1105Too many auth attempts, try again later
Global errors can occur while running. See their descriptions on this page.
Version historyShow all
audio.getAlbums, audio.addAlbum, audio.editAlbum, audio.addAlbum, audio.deleteAlbum audio.moveToAlbum are deprecated.

auth.restore method has new required last_name parameter.
messages.getLongPollServer method has new lp_version parameter.
ads.getCategories method returns response in a new format.
wall.edit method cannot be used for edit a promotion post. wall.editAdsStealth method should be used instead.