Hi all,
I need some help using an API with a POST call to subtract a certain number of days from a date.
This is the API I’m trying to use.
I have tried a few methods of calling the API but all are returning a status of 415.
Thanks!
Hi all,
I need some help using an API with a POST call to subtract a certain number of days from a date.
This is the API I’m trying to use.
I have tried a few methods of calling the API but all are returning a status of 415.
Thanks!
415 means the supplied data is not in the correct format.
Ahhh. Here is the link the website of the API I’m using: DateCalculatorUi
This is my first time using a pOST call so I’m unsure of the correct format.
Aha! I figured out the issue: I needed to add the header with content-type and accept fields.
Here’s a screenshot for anyone else who faces the same problem:
I’ve read a lot of posts from people who want to calculate dates by adding/ subtracting days, I finally found this API which works really well.
You only need to add the content type
Is this API still working yet? I tried to access since last week with no success…
@muneer or @codeswept do you know something?
Unfortunately, the web service is no longer available.
You need to find a similar service.
That’s the problem to develop apps with external dependencies… Due the lack of support on date calculation in Thunkable it’s hard to deal with dates without external APIs…
@muneer I was thinking in develop an internal function to calculate dates difference or sum / subtract days from a date and avoid this kind of external dependency… Do you know any public project with this function done to use as model?
Check this project.
https://x.thunkable.com/projectPage/60d06b27eb9be10011749fcd
This is based on JavaScript
You can enter the date and then enter the number of days (+ / -) and you will get the date.
Another way is to connect a Google sheet to the project and calculate dates in the sheet and get the result as you would do with data records.
@muneer do you have this project done in Thunkable X ?
I’m not familiar with this new version and I see some differences in the webAPI component in the new and old version.
I tried to implement in the version X, but I didn’t find the method POST MESSAGE in the component…
Any help will be appreciated!
Thanks
Thunkable X is the current version of Thunkable and includes both the Snap to Place (StP) and Drag and Drop (DnD) interfaces. API blocks are found here:
Snap to Place
After you drag a Web API component to a screen, you’ll see this in the Blocks tab:
@tatiang , Please check the example project posted by @muneer above…
You’ll see that the webAPI component is quite different… so that’s why I can’t use in the older version X of thunkable…
There is no way to implement same same way in the two version, so I asked if he have an example in the X version.
I did not use the Web API
component. I used a Web Viewer
I was only responding to your question about where to find the API POST command. Sorry if that wasn’t helpful.
Edit: Ah, @muneer’s comment directly above helps explain the confusion.
Yes, I see my mistake…
Thank you for your supportive attitude !!!