jublo / codebird-php

Easy access to the Twitter REST API, Direct Messages API, Account Activity API, TON (Object Nest) API and Twitter Ads API — all from one PHP library.
https://www.jublo.net/projects/codebird/php
GNU General Public License v3.0
776 stars 234 forks source link

collections_entries_curate does not remove tweets from collection #240

Closed nemanjam closed 6 years ago

nemanjam commented 6 years ago

Adding tweets works but removing wont. I get:

array(3) (
  [errors] => array(1) (
    [0] => array(2) (
      [message] => (string) Internal error
      [code] => (int) 131
    )
  )
  [httpstatus] => (int) 500
  [rate] => null
)

I send params like this:

[id]  => (string) custom-123,
[changes] =>
array(19) (
  [1029736384695881730] => array(2) (
    [op] => (string) remove
    [tweet_id] => (string) 1029736384695881730
  )
  [1032286192111366145] => array(2) (
    [op] => (string) remove
    [tweet_id] => (string) 1032286192111366145
  )...
mynetx commented 6 years ago

@nemanjam Can you please try with parameters like this?

$params = [
  'id' => 'custom-123',
  'changes' => [
    [
      'op' => 'remove',
      'tweet_id' => '1029736384695881730'
    ],
    [
      'op' => 'remove',
      'tweet_id' => '1032286192111366145'
    ]
  ]
];
nemanjam commented 6 years ago

Yes, that's it. collections/entries somehow returns tweets ids instead numerical keys.

mynetx commented 6 years ago

@nemanjam Glad to see it works for you now! Thanks for asking. :)