Hi,
thanks for your question, and sorry for the trouble.
Unfortunately, I’m not sure if this is possible, due to how WordPress’ internal HTTP API works… 🙁
You could maybe try a way that works for URLs in the browser, where you add the username and password to the URL:
http://username:[email protected]/table.json
Regards,
Tobias
Thread Starter
steenf
(@steenf)
Thanks
It was an error on api, but it still does not work
https://username:[email protected]/api/members?version=1
I can send username and password to demo web?
Have tried from another web without authentication and it works
but how do I make table header?
Steen
Hi Steen,
I’m not sure what you mean, I’m afraid.
It seems like you are trying to access an arbitrary JSON API. This won’t work. TablePress only understands its own JSON format, that is a two-dimensional array that resembles a table. It’s not possible to use any existing JSON API, I’m afraid.
Regards,
Tobias
Thread Starter
steenf
(@steenf)
Okay
It is data from external side whit authentication .
Same format on this page without authentication.
The json format I try to import look like this :
http://dpit.dk/test/steen.php
But no table header in import tabel.
Steen
Hi,
yes, this JSON format will not work, I’m afraid (regardless of authentication or not). It is not a JSON format that TablePress can understand and turn into a table.
Your best chance probably is to develop an intermediate script that retrieves the data from the API (with authentication), and then transforms it to a table format (i.e. a two-dimensional array). This can then be imported into TablePress.
Regards,
Tobias
Hi,
sure, you are very welcome! Sorry that I couldn’t offer a working solution here.
Regards,
Tobias