Facebook API针对返回中文的句子行

时间:2016-10-05 16:41:17

标签: facebook-graph-api

我用api版本2.7调用facebook定位句子行,并根据环境获得不同的结果。在分期和开发中,我得到:

{
  "targetingsentencelines": [
    {
      "content": "Location - Living In:",
      "children": [
        "United States: Decatur (+10 mi) Georgia"
      ]
    },
    {
      "content": "Age:",
      "children": [
        "18 - 65+"
      ]
    },
    {
      "content": "Placements:",
      "children": [
        "News Feed on mobile devices, News Feed on desktop computers or Right column on desktop computers"
      ]
    }
  ]
}

然而,在preprod我得到:

{
  "targetingsentencelines": [
    {
      "content": "Location - Living In:",
      "children": [
        "United States: Decatur (+10 mi) Georgia 喬治亞州"
      ]
    },
    {
      "content": "Age:",
      "children": [
        "18 - 65+"
      ]
    },
    {
      "content": "Placements:",
      "children": [
        "News Feed on mobile devices, News Feed on desktop computers or Right column on desktop computers"
      ]
    }
  ]
}

使用Graph Explorer API v2.7(https://developers.facebook.com/tools/explorer/)和uri:

act_FACEBOOK IDENTIFIER / targetingsentencelines?targeting_spec = {%22geo_locations%22:{%22cities%22:[{%22key%22:%222431637%22,%22radius%22:%2210%22,%22distance_unit%22:% 22英里%22}]},%22age_min%22:%2218%22%22device_platforms%22:[%22mobile%22%22desktop%22],%22publisher_platforms%22:[%22facebook%22],%22facebook_positions%22 :[%22feed%22%22right_hand_column%22]}

我得到与登台和开发相同的结果。

1 个答案:

答案 0 :(得分:1)

添加local = en_US确实有效。我第一次误输了它。