M
M
Maxim2017-01-19 11:38:58
Classmates
Maxim, 2017-01-19 11:38:58

What is the error in composing signature for the method mediatopic.post?

Faced with the problem of the signature before sending the photo, the text before that is sent from the server without problems.

{"media": [{"list": [{"id": "moWN4ruoKwRHkR5cAcxemsyNteEiyaChwXZKgwgphHKKU8qcEgmqbWHrlUzx1qBMX18Wd8HaLx47h9VE1qV0yQhfVyMwXWQgsmx+IdyedNuP+cEs5eS87OUyG17GPT8MvJCulrIPLVcu6E7+49MrBw=="}], "type": "photo"}]}

Attachment is formed in json. The same example was copied and sent from classmates without any complaints. But OK signatures are different from mine.
The procedure for generating a request is similar.
Approximately 1 time out of 10 photos are fasted, the rest 104 are wrong
. What's the catch?
7e4963ae1f3148d2a016addd3b702924.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vjacheslav Kanivetc, 2017-01-19
@maximkv25

Probably an encoding problem.
Options:
do not encodeUtf8 when calculating the signature
do not do encodeUriFragment when generating the request-parameters itself after calculating the signature
, the md5 function does not work correctly (yes, not all implementations work adequately with Russian text)
Compare the code how you prepare the request for sending with what it does, for example js sdk - https://github.com/odnoklassniki/ok-js-sdk/blob/ma...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question