Answer the question
In order to leave comments, you need to log in
How to generate sig parameter for external sites working with Odnoklassniki API?
Odnoklaanikov API swears at my "sig" parameter.
Someone faced such a problem?
The method I want to use is "friends.get".
Here is how I tried to generate this parameter.
$sig = md5("application_key={$app['key']}format=jsonmethod=friends.get" . md5("{$token['access_token']}{$app['secretKey']}"));
[error_code] => 104
[error_msg] => PARAM_SIGNATURE : Invalid signature 3de87d239a55e1adb910c11d0fb8273c, calculated by string application_key=CBAKALELEBABABABAuid=513071848033********SECRET KEY*******
Answer the question
In order to leave comments, you need to log in
This is clearly stated in the official documentation. Specifically, in the Authentication and Authorization section.
The array is sorted alphabetically by key
. All key/value pairs are concatenated in key=value format (skipping the access_token and sig parameters).
The session_secret_key (if present) or the application secret key (if session_secret_key is missing) is appended.
The md5 hash of the entire string is taken (the string must not be in the URL-encode format, the encoding must be UTF-8).
The result is converted to lower case.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question