When added to the URL the endpoint complains with the error
{
"error": {
"message": "(#100) date_preset must be one of the following values: today, yesterday, this_month, last_month, this_quarter, maximum, data_maximum, last_3d, last_7d, last_14d, last_28d, last_30d, last_90d, last_week_mon_sun, last_week_sun_sat, last_quarter, last_year, this_week_mon_today, this_week_sun_today, this_year",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Af7UW8liBFkZ_n4YuiC-_KS"
}
}
You can see from the URL that was built for the request the date_preset is uppercase - manually changing it to lower case produces the correct response from the endpoint
Which SDK version are you using?
20.0.0
What's the issue?
Date preset enums
EnumDatePreset
are being serialized to the graph API URLs parameters as upper case values. Producing a message 100 errorSteps/Sample code to reproduce the issue
Observed Results:
When added to the URL the endpoint complains with the error
You can see from the URL that was built for the request the date_preset is uppercase - manually changing it to lower case produces the correct response from the endpoint
https://graph.facebook.com/v20.0/act_1289608875113430/adsets?limit=100&access_token=XXXXXXXX&date_format=U&appsecret_proof=XXXXXXXXXXX&fields=id%2Caccount_id%2Ccreated_time%2Cupdated_time%2Cend_time%2Ccampaign%2Cbudget_remaining%2Cdaily_budget%2Ceffective_status%2Cname&date_preset=LAST_90D
Expected Results:
I expect the enum values to be serialized to the url in lower case as in
last_90d
notLAST_90_D