cartodbclient-php icon indicating copy to clipboard operation
cartodbclient-php copied to clipboard

Api v2 support?

Open asamiam opened this issue 11 years ago • 5 comments

dropTables and getTables are not working for me. I checked the API and in my account it lists v2. The top of this class is /api/v1/. Maybe that's why?

When I do a createTable after my dropTable failed, using the same name instead of resulting in an error I get a magical new table with the name and "_1" or "_2" depending on how many times it has happened. I think it would make a lot more sense to return an error in case of a name collision and have the user handle that scenario. That doesn't belong here per se but I haven't found where it happens in the cartodb repo.

asamiam avatar Feb 05 '14 14:02 asamiam

Unfortunately this library is using a non-documented API. We will take a look because the api didn't changed and it should work cc @kartones

javisantana avatar Feb 05 '14 14:02 javisantana

Unfortunately the internal non-documented API has dropped support of performing a api/v1/tables GET and api/v1/tables/tablename DELETE so those two methods won't work anymore.

I'm doing some testing to allow again to both retrieve a list of table objects and drop a table, will get back as soon as I have it ready.

Kartones avatar Feb 05 '14 17:02 Kartones

Should be fixed now.

New way of retrieving tables list using getTableVisualizations() and dropping a table using dropTableVisualization() is slower, as it has to:

  • First, fetch all visualizations
  • Check which ones are type=table (canonical visualizations)
  • Grab 1 by 1 each table data, and build the list
  • Finally return the list of tables

Dropping a table also needs to first fetch all visualizations.

I've marked as deprecated getTables() and dropTable() to make sure any PHP API user adapts to the format of the returned data in the new methods.

Hope it's easy for you to adapt to the new methods, but there is no quick way of restoring old behaviour :(

Kartones avatar Feb 05 '14 18:02 Kartones

DropTableVisualization() isn't working most of the time, and seems to be breaking the relationship between my tables when it does do something.

asamiam avatar Feb 14 '14 21:02 asamiam

I can't get oauth to work with the latest git master.. is this library just hopelessly out of date now?

Ramblurr avatar Jul 29 '14 10:07 Ramblurr