S
S
Stanislav Kudelko2017-01-12 11:27:33
In contact with
Stanislav Kudelko, 2017-01-12 11:27:33

How to set group header via VK API?

For starters, here's what a group header is:
f9ed7ae303c24213b55e504ef51d4e96.png
The API documentation says absolutely nothing about loading. Forays through unofficial clients no longer help, because they do not implement this (reference to this question). By looking at the requests, I found that the call signature does not look like any of the file upload methods/methods listed here . So, what I was able to unearth from the requests:
1. Each file uploaded to the header has a _sig. It strangely changes from request to request, but without it you can't download the file.
2. If we catch VK requests, then we will get a static link to download the file. This static link works fine and when you go to it, it says this:

{"error":"ERR_UPLOAD_FILE_NOT_UPLOADED: file not found","bwact":"owner_cover","server":836521,"mid":151665536,"_sig":"83447078c5079124026b80d90f116398"}

However, after executing the download in the code, we get:
{"error":"ERR_UPLOAD_BAD_SIGNATURE","bwact":"owner_cover","server":836521,"_sig":"d762c16dc795c4f65b59aafdaa39628a"}

3. The method used by VK (usually the method is visible in the act parameter . Let's say, when downloading an audio message , it was add_doc ), is missing in the documentation and looks like this: act=owner_cover .
Who is interested - please help. Thanks in advance for your answers! If you have any ideas - they can also be in the answers or comments. Perhaps the question will also grow like this one ...
P/s The question is duplicated here: ru.stackoverflow.com/q/613687/219079

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Aksentiev, 2017-01-12
@flerry

The first POST request goes to https://vk.com/al_page.php
parameters: act=owner_photo_box&al=1&cover=1&oid=-85297730
https://gist.github.com/S-anasol/643d82f34ca6518d4...
The response will be code with an upload initializer and it will contain a link including the first _sig
Further, _sig changes from request to request, there is one more involved, you get it after the first upload.

K
kpa6uu, 2017-01-12
@kpa6uu

When I had similar problems with the VK API, I turned to support for help.
I'm sure they will help in this case too.
PS: if the issue is not resolved - in the evening I'll dig into the loading of caps, I'll try to help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question