Hey! Is it possible to setup policy to restrict calls only to specific days of a week? And the same with specific hours. For example: Five days per week (not Saturday and Sunday) from 7 a.m. to 7 p.m. Cheers, Tomas
Solved! Go to Solution.
Dear @Tomasz Korecki ,
Welcome to Apigee Community 🙂
Yes, It's possible. You can able to achieve same using Apigee Javascript Policy with minimal code.
var d = new Date(); var n = d.getDay(); var n = d.getHours();
Cheers,
Anil Sagar
I am really amazed by trace and Api console tools.
I've made few changes:
<PreFlow name="PreFlow"> <Request> <Step> <Name>JavascriptDatetimeParametersPolicy</Name> </Step> <Step> <Name>WorkingDaysAndHoursRaiseFault</Name> <Condition>(requestReject is true)</Condition> </Step> </Request> <Response/> </PreFlow>
And it works as I want to. Thank you guys!
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |