E
E
EvgMul2016-08-24 14:26:58
PHP
EvgMul, 2016-08-24 14:26:58

Why does mediatopic.post method return error 100?

Hello, I have the following problem. I'm trying to publish a post to a group using the mediatopic.post method, but it returns the following error:

array(3) { ["error_code"]=> int(100) ["error_msg"]=> string(56) "PARAM : Only one of session_key or uid must be specified" ["error_data"]=> NULL }

The GROUP_CONTENT rights on the application have been granted.
The function code is the following:
public function ok()
  {
    if (!OdnoklassnikiSDK::checkCurlSupport()) {
      print "У вас не установлен модуль curl, который требуется для работы с SDK одноклассников.  Инструкция по установке есть, например, <a href=\"http://www.php.net/manual/en/curl.installation.php\">здесь</a>.";
      return;
    }

    if (!is_null(OdnoklassnikiSDK::getCode())) {
      if (OdnoklassnikiSDK::changeCodeToToken(OdnoklassnikiSDK::getCode())) {
        $params = array(
          'uid' => '572863283691',
          'type' => 'GROUP_THEME',
          'gid' => '54201097322731',
          'attachment' => '{"media": [{"type": "text","text": "hello"}]}',
          'format' => 'json'
        );

        $testPost = OdnoklassnikiSDK::makeRequest("mediatopic.post", $params);

        var_dump($testPost);

      }
    }
  }

Tell me what the problem is, I'm already worn out with this API to fight.
Thanks in advance to all who respond.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
EvgMul, 2016-08-24
@EvgMul

The problem is solved as follows: removed the line 'uid' => '572863283691',
from the parameter array.

V
Vitaliy Orlov, 2016-08-24
@orlov0562

Not sure, but perhaps the answer is already here:
https://toster.ru/search?q=Only+one+of+session_key...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question