WidgetMediatopicPost reason, "error_code":"104","error_msg":"Bad signature "?

Hello, the function WidgetMediatopicPost error 104, can anybody tell what is the reason? Can anyone come across??
Here's the code that throws the error
OKSDK.init(config, function () {
console.log("received");


OKSDK.REST.call(
'users.getCurrentUser',
 null, 
 function (status, data, error) {
 if (status == 'ok') {
alert("yes");
console.log(data);
$('#id_ok').val(data.uid);
$('#name_ok').val(data.name);
$('#surname_ok').val(data.last_name);

 var tree = {"media": [
{
 "type": "text",
 "text": "hello"
}
]};

 // The object tree to a JSON string
 var str_tree = JSON.stringify(tree);

 // Encode a JSON string to substitute in the URI as parameter
 var coding_str_json = encodeURIComponent(str_tree);
 var secret_key = getParameterByName('session_secret_key');
 var st_return = 'https://my.site.ru/';
 //var access_token = getParameterByName('access_token');
 var access_token = '-s-aIic8Iwxhjg9grzvFp93d-V0El89AJwVDjf5bMw-9******************FlA5cr.x7LAfhM.UCh78BJwd';
 //var signature_md5 = "st.attachment=" + str_tree + "st.return=" + st_return + secret_key;
 var signature_md5 = "st.attachment=" + tree + secret_key;
 var signature = md5( "St. attachment=" + tree + secret_key);

 document.location.href="https://connect.ok.ru/dk?" +
 "St. cmd=WidgetMediatopicPost&" +
 "St. app=1265742592&" +
 "St. attachment=" + coding_str_json + "&" +
 "St. signature=" + signature + "&" +
 // "st.return=" + st_return + "&" +
 "St. access_token=" + access_token;



 } else {
 alert('Unable to retrieve current user' + OKSDK.Util.toString(error));
}
 });
June 5th 19 at 21:59
1 answer
June 5th 19 at 22:01
You use are ok-js-sdk
So why not take advantage of OKSDK.Widgets.post(...) which he considers a signature?

Find more questions by tags Classmates