3

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.

parametertypeexample valuedescribe
tokenstringYOUR_API_TOKENyour API token
start_datestring2020-12-12start date
daysint10days
end_datestring2020-12-31end date

Below are all the parameters in the response.

parametertypeexample valuedescribe
codeint00 means the request was successful
dayOffint10shift
holidayint10statutory holidays
totalint30total days
weekdayint30working day
weekendint30weekend

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.


xx19941215
2.3k 声望365 粉丝

// 刻意练习 每日精进