如何在linkedin中使用json定位多个公司股票

如何在linkedin中使用json定位多个公司股票,linkedin,linkedin-api,Linkedin,Linkedin Api,在,targeting_shares的json格式如下所示。我不知道如何使用此格式瞄准多个共享目标或具有多个值的单个共享目标。有人知道这件事吗 { "visibility": { "code": "anyone" }, "comment": "Testing a full company share!", "content": { "submitted-url": "https://www.example.com/content.html", "title

在,targeting_shares的json格式如下所示。我不知道如何使用此格式瞄准多个共享目标或具有多个值的单个共享目标。有人知道这件事吗

{
  "visibility": {
    "code": "anyone"
  },
  "comment": "Testing a full company share!",
  "content": {
    "submitted-url": "https://www.example.com/content.html",
    "title": "Test Share with Content",
    "description": "content description",
    "submitted‐image-­url": "https://www.example.com/img.jpg"
  },
  "shareTargetReach": {
    "shareTargets": {
      "shareTarget": {
        "tvalues": {
          "tvalue": "na"
        },
        "code": "geos"
      }
    }
  }
}
从文档中:

要以共享为目标,请修改共享请求的正文,通过在共享目标到达共享目标列表中定义一个或多个共享目标元素来描述要以其为目标的各种段和值。共享目标包含一个代码和一个tValue列表,这些tValue表示您希望目标的各种段值

因此,您只需要在共享目标中添加新的共享目标块,如下所示:

{
  "visibility": {
    "code": "anyone"
  },
  "comment": "Testing a full company share!",
  "content": {
    "submitted-url": "https://www.example.com/content.html",
    "title": "Test Share with Content",
    "description": "content description",
    "submitted‐image-­url": "https://www.example.com/img.jpg"
  },
  "shareTargetReach": {
    "shareTargets": {

      // 1st Share target
      "shareTarget": {
        "tvalues": {
          "tvalue": "D"    // 51-200 employees
        },
        "code": "companySizes"
      },

      // 2nd Share target
      "shareTarget": {
        "tvalues": {
          "tvalue": "edu",   // Education
          "tvalue": "finc"   // Finance
        },
        "code": "jobFunc"
      }

    }
  }
}
只需确保删除所有的//-注释,这些注释只是为了帮助说明发生了什么,否则会阻塞JSON解析器