0

I am integrating Active Collab 5 API on my site. Using following code to post commetns on any task

try {

   $pp = $client2->post('comments/task/51794', [

        "body" => "this is test comment"

    ])->getJson();

    echo "<pre>"; print_r($pp); echo "</pre>";

} catch(AppException $e) {

    print $e->getMessage() . '<br><br>';

}

but I am facing an strange issue, instead of posting only one comment API is posting two duplicates comments means two same comments instead of one. Can any one share me what is the issue here.

  • Check your surrounding code, and make sure that you are not calling the API twice. Add logging where needed, to confirm that you are actually calling the API only once. Active Collab frontend uses that same API as you are triggering, and if it is not posting two comments when you comment using web interface, you don't have a bug in Active Collab, but in your code. – Ilija May 02 '16 at 10:53
  • after adding logging I can identify the issue , thanks – Bharat Bhartia May 04 '16 at 10:12

1 Answers1

0

Check your surrounding code, and make sure that you are not calling the API twice. Add logging where needed, to confirm that you are actually calling the API only once. Active Collab frontend uses that same API as you are triggering, and if it is not posting two comments when you comment using web interface, you don't have a bug in Active Collab, but in your code.

Ilija
  • 4,105
  • 4
  • 32
  • 46