简体   繁体   中英

Facebook API: how to remove business page hours?

I can't find a way how to remove open or close hours from Facebook page using Facebook API. I have page that looks like this:

{ 
  ...
  "id": "123456", 
  "category": "Business services",       
  "hours": { "mon_1_open": "15:00", "mon_1_close": "18:00" }
}

If I post this FB OpenGraph data:

{ "hours": {"tue_1_open": "15:00", "tue_1_close": "18:00"} } 

FB updates page hours and now page hours looks like this:

{ 
  ...
  "hours": { 
    "mon_1_open": "15:00", "mon_1_close": "18:00", 
    "tue_1_open": "15:00", "tue_1_close": "18:00"
  }
} 

The problem is that I cant find a way how to remove "mon_1_open" at all. I tried to update mon_1_open with values 0, false, null, but facebook api converts this to "00:00". How to make FB API remove mon_1_open field?

Thanks for your help

You should send string 'none', like this:

{ 
  ...
  "hours": { 
    "mon_1_open": "none", "mon_1_close": "none", 
    "tue_1_open": "15:00", "tue_1_close": "18:00"
  }
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM