M
M
Mnobody2014-02-02 06:23:29
PHP
Mnobody, 2014-02-02 06:23:29

Why does the WebAPI doMyContact method return an empty table?

allegro.pl/webapi/documentation.php/show/id,1177
My code:

$contacts = $client->call(
  'doMyContact',
  array(
    array(
      'sessionHandle' => $session['sessionHandlePart'],
      'auctionIdList' => array(/*auction id*/),
      'offset' => 0
    )
  )
);
if (isset($contacts['faultcode']) && isset($contacts)) {
  echo 'fault code: ' . $contacts['faultcode'] . ' <br/>';
  echo 'fault string: ' . $contacts['faultstring'] . ' <br/>';
} else if (isset($contacts)) {
  var_dump($contacts); //array(1) { ["mycontactList"]=> string(0) "" } !!!
}

According to the example from the site:
allegro.pl/webapi/tutorials.php/tutorial/id,261
if (isset($contacts['mycontactList']['item'])) {
  foreach ($contacts['mycontactList']['item'] as $row) {
    $myContacts[$row['contact-user-id']] = $row;
  }
}

The method should return a table with nested tables, but will only return an empty table.
Everything is fine with authorization, everything works fine for another method.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mnobody, 2014-02-02
@Mnobody

Based on this unanswered post from a year ago, the doMyContact method simply doesn't work. And this one works:

$contacts = $client->call(
  'doGetPostBuyData',
  array(
      'parameters' => array(
      'sessionHandle' => $session['sessionHandlePart'],
          'itemsArray' => array(
      	    'item' => array(/*auction id*/)
    )
      )
  )
);

Maybe someone will come in handy, although I doubt it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question