introduce
Holiday API core services are hosted on Alibaba Cloud and Tencent Cloud, and the API is naturally distributed and highly available.
start
If you need to know what day is N working days after a certain date, you can use GET or POST to make a request to the entry below.
https://calc.ygcf.info/api/v1/workday/end
If you need to know the distribution of working days before a certain date, you can use GET or POST to initiate a request to the entry below.
https://calc.ygcf.info/api/v1/workday/count
example
If you need to get the day after 2020-12-12 10 working days.
https://calc.ygcf.info/api/v1/workday/end?start_date=2020-12-12&days=10
If you need to get the distribution of working days from 2020-12-12 to 2020-12-31.
https://calc.ygcf.info/api/v1/workday/count?start_date=2020-12-12&end_date=2020-12-31
Certification
After registration, you can obtain the token in the personal center, and add the token parameter in your API request to obtain authentication.
https://calc.ygcf.info/api/v1/workday/end?
start_date=2020-12-12&days=10
&token=YOUR_API_TOKEN
parameter
Below are all the parameters you can add in your request.
parameter | type | example value | describe |
---|---|---|---|
token | string | YOUR_API_TOKEN | your API token |
start_date | string | 2020-12-12 | start date |
days | int | 10 | days |
end_date | string | 2020-12-31 | end date |
Below are all the parameters in the response.
parameter | type | example value | describe |
---|---|---|---|
code | int | 0 | 0 means the request was successful |
dayOff | int | 10 | shift |
holiday | int | 10 | statutory holidays |
total | int | 30 | total days |
weekday | int | 30 | working day |
weekend | int | 30 | weekend |
Mistake
If the HTTP status code of the request returns 4xx or 5xx, the returned data will have a msg field indicating the reason for the error.
Below is an example of what is returned when the wrong token is used.
{
"code": 422,
"data": [
],
"msg": "token不正确"
}
You can go to https://calc.ygcf.info/docs for detailed documentation.
Go to the developer center https://calc.ygcf.info/reg register an account and get TOKEN to start using it.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。