HubDB update/replace table CSV upload help needed [php]
Can someone help me translate this into how a php curl would be? I’m unable to figure it out and just get 401 errors. I believe I’m doing it all wrong.
Here is a a portion of the code I have below. The bottom function works to update the name of the table. That uses oauth2 just fine – I just have a problem forming this multipart post. I just can’t wrap my head around it:
HubDB update/replace table CSV upload help needed [php]
If I change the header to:
curl_setopt($curl, CURLOPT_HTTPHEADER, [“Authorization: Bearer $accessToken”, “Content-type:multipart/form-data”]);
I get a 500 response
{“status”:“error”,“message”:“internal error”,“correlationId”:“cbd9226e-6c49-44f0-b70a-0ab0c9eda4cf”,“requestId”:“b8fe469f49431e95d690ec04efdf9c9d”}
I get this 500 response or a 415 response. I can’t seem to figure out anything else
POST /hubdb/api/v1/tables/:tableId/import - import a CSV file into a HubDB table
The example uses a hapikey to keep the it simple, but you should be able to use an access token using the code you have in your last post before line 21 in the example: