Setting age restriction returns false
-
28-02-2021 - |
Question
Using the sample PHP code on this page works great for setting the restriction to {"location":"US"}
however it returns false when trying to set it to {"age":18}
or {"age":"18"}
. Is there a special way which this needs to be formatted in order to set an age restriction?
See the list of available restrictions here.
Thank you.
Solution
Instead of using {"age":"18"}
, use {"age_distribution":"18+"}
.
I don't know why using "age" doesn't work. The documentation says it should work, but it didn't work for me either.
However, using age_distribution
does work.
OTHER TIPS
try something like
{"type":"alcohol"}
this should only be a workaround as the legal age for alcohol is similar
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow