Upload a file into file storages from ESP32

Hi community,
Is there a way to upload a file txt into file storages from ESP32?
I have found a way to upload from another storage (not thinger) by using FTP connection, but I haven’t found the FTP port on Thinger. Could you help me please?
Have a nice day!

Hi,

I guess it can be done by the api, check this → Swagger UI

You need to use a HTTP client that supports the PUT method on the esp32.

Hope this helps.

Yes, ESP32 supports the PUT request. I’m testing it but I get this response:

{
“error”: {
“message”: “unauthorized”
}
}

Error code number: 401

I’ve found a “auth button” where insert my credential, but there are two input text (client_id and client_secret). Where can i find this information?

do not consider the post previously. I solved

Sorry, I’ve have a problem with post request: on Swagger for creating a file I need to send a post request without sending a JSON string content.
If I do it, I receive status 200 but not load the file. I read other API request and in every post I need to insert a Json string inside the content. Into API command for creating file there isn’t this string. If I try insert a custom JSON string, I receive this response:

{
“error”: {
“message”: “invalid schema”
}
}

What’s the correct schema?

Hi @Salvatore_Scarantino

In this case the body of the request would be:

{"files":
    ["new_file"]
}

If you wanted to create a folder/directory:

{"folders":
    ["new_folder"]
}

You can also use the inspect tools of your browser to analyze the requests made by the platform, as the Swagger API may not be fully documented.

Regards!

Perfect! They work perfectly! Thank you for your support

I am trying to do something similar by uploading a file from ESP32 to storage. I managed to use the API for other things but I cannot find out how to upload a specific file.