# Need help using date calculator API

**URL:** <https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086>\
**Category:** Questions about Thunkable X\
**Created:** [September 3, 2021, 4:32pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086 "2021-09-03T16:32:02Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [September 3, 2021, 4:32pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/1 "2021-09-03T16:32:02Z")

</div>

Hi all,  
I need some help using an API with a POST call to subtract a certain number of days from a date.

 ![Screen Shot 2021-09-03 at 10.00.30 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/6/96a7fbcb0ba401add4586c089341d8d78f354ef7.png)

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.

 ![Screen Shot 2021-09-03 at 10.09.50 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/5/b5dad338f67e1f5e68ebb12257fd97c75bc7cd6f.png)  
 ![Screen Shot 2021-09-03 at 10.11.15 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/8/983126e34f2061f751985ad058880c7a7f621ac6.png)

Thanks!

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [September 3, 2021, 4:45pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/2 "2021-09-03T16:45:33Z")

</div>

415 means the supplied data is not in the correct format.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [September 3, 2021, 4:46pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/3 "2021-09-03T16:46:19Z")

</div>

Ahhh. Here is the link the website of the API I’m using: [DateCalculatorUi](https://date-calculator.org/api-documentation)  
This is my first time using a pOST call so I’m unsure of the correct format.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [September 3, 2021, 4:52pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/4 "2021-09-03T16:52:32Z")

</div>

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:

 ![Screen Shot 2021-09-03 at 10.21.32 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/2/0255eb5d40f7b02e65088b43ce6e7fec69b50855.png)

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.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [September 3, 2021, 4:55pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/5 "2021-09-03T16:55:31Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/9/991b5e38245930be9c0e6d87a7658fb187c0e1cd.png)

You only need to add the content type

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/b/0bcfcd7e24eba0582e39c2c5631b4f2312ae42de.png)

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [October 26, 2021, 6:35pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/6 "2021-10-26T18:35:16Z")

</div>

Is this API still working yet? I tried to access since last week with no success… ☹

@muneer or @codeswept do you know something?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 26, 2021, 6:51pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/7 "2021-10-26T18:51:08Z")

</div>

Unfortunately, the web service is no longer available.

You need to find a similar service.

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [October 26, 2021, 6:58pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/8 "2021-10-26T18:58:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 26, 2021, 7:18pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/9 "2021-10-26T19:18:46Z")

</div>

Check this project.  
[https://x.thunkable.com/projectPage/60d06b27eb9be10011749fcd](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.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/d/3d34458103aee041097fdf4bbe228577a7d35355.png)

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.

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [October 27, 2021, 5:30pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/10 "2021-10-27T17:30:37Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 27, 2021, 5:54pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/11 "2021-10-27T17:54:17Z")

</div>

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:  
` `

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b9fb0854683b040cd9d3aad70691b41e3394bd9d.png)  
` `  
**Drag and Drop**  
` `  
After you add a Web API, you’ll see this in the Blocks tab under the Advanced section:  
` `  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/6/e6613c188c518506802dc9371b0ae8fb8604c419.png)

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [October 27, 2021, 8:10pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/12 "2021-10-27T20:10:47Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 27, 2021, 9:06pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/13 "2021-10-27T21:06:50Z")

</div>

I did not use the `Web API` component. I used a `Web Viewer`

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 27, 2021, 10:21pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/14 "2021-10-27T22:21:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paulovaz72](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/paulovaz72/32/119071_2.png) [@paulovaz72](https://community.thunkable.com/u/paulovaz72)\
**Post date:** [October 28, 2021, 5:02pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/15 "2021-10-28T17:02:50Z")

</div>

Yes, I see my mistake… 🙂

Thank you for your supportive attitude !!!

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:17pm UTC](https://community.thunkable.com/t/need-help-using-date-calculator-api/1486086/16 "2024-11-08T13:17:00Z")

</div>


