A
A
Alexander Pronin2018-02-25 18:00:04
API
Alexander Pronin, 2018-02-25 18:00:04

How to create a topic in the ok.ru group with an uploaded image?

We do according to the instructions:


  1. photosV2.getUploadUrl - get upload URL and photo_id
    • photo_id: YGqGie1JynOwvdcXebbV1sdanww6GitK/DaGZ7KLtKjeW1UqTtCX3Q==
    • upload_url: https://gup.mycdn.me/uploadImage?apiToken=16fv9Hai...


  2. Upload the image to the received URL. Obtain token images
    { "photos" => { "YGqGie1JynOwvdcXebbV1sdanww5GitK / DaGZ7KLtKjeW1UqTtCX3Q ==" => { "token" => " RSflhI / z9EYo93p6gMuJ uZNP4WiT0Dum3D9KHF7ONoSVSdEwqfimKjcq85vyqppYyRqVPfKpze1c4ikZQagZ4UKUeWLZmBuz9bDElSE + + + hho 11GqwtI / D3XQ3esJbbfhnJzKlfrn76e3 Pn1snpy6CWmv7JVT55p0MF3JWLTE9 + + / + u1NoEorBMxCoD 58iy1L79Z8DjGdHM = "}}}

  3. DO NOT use the photosV2.commit method because:
    Do not call this method for photos posted to group media topics, announcements, and announcement directories.

    When posting to a group, photos don't need to be linked to an album and don't need to call photosV2.commit


  4. We call the mediatopic.post method :
    • type=>"GROUP_THEME"
    • "gid": "53919165676890"
    • "attachment": '{"media":[{"type": "photo","list":[{"id": "IMAGE_TOKEN_FROM_ITEM_#2"}]}]}'

    and here we get an error:
    {"error_code"=>100, "error_msg"=>"PARAM : Photos should not belong to the album .", "error_data"=>nil}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Ezergil, 2018-02-26
@Ezergil

Alexander Pronin when calling photosV2.getUploadUrl, you do not need to set aid. This is exactly what the error says
(I myself suffered from this garbage last week ..)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question