Asked by Kevin on August 10, 2025
How do I retrieve a single record from the costar_days table using a field named "date" in the query? Also, how can I avoid or automatically append the "T00:00:00.000Z" suffix to YYYY‑MM‑DD values?
Answered by Twidget
Convert the incoming date text input to a Date (or the platform’s date object) and then query the database using that date field. A working datetime format is like 2025-08-08T00:00:00.
To append a time suffix to a date string, use the Concat command (for example, concat(dateText, 'T00:00:00')). You do not need to include the ":000Z" component unless your external system requires that exact format.
Uploading files via API (curl example)
When uploading files with curl use the --form parameter. Example:
curl --location 'http://f343f.twidget.io/files/single' \ --form 'single=@"/OneDrive/Pictures/image.jpg"' \ --form 'path="/folder/file.png"'
This uses multipart/form-data to send the file.
Testing Twidget APIs with Postman or other front ends
Yes. APIs you create in Twidget can be tested with Postman or used by any front‑end client.
Using Twidget to build a website
Yes — you can build both front‑end pages and backend APIs with Twidget.
CSV re‑import behavior (update vs duplicate)
Reimporting data into a table creates new records; it does not update existing records.
Downloading Zoom recording and saving file bytes
Yes. Use the HTTP Request command with response type set to ArrayBuffer to receive file bytes, then store those bytes as a file in Twidget’s file manager. From there you can transfer the file to YouTube using the YouTube API or another service.