Tracking codes data type and manipulation

喜欢而已 提交于 2019-12-02 12:10:51

Ok... No answers here, and none from Box support, so I experimented and contacted another enterprise whose working script I could use as a base.

  1. "tracking_codes" need to be enabled for the enteprise. The documentation does not mention this. If you don't enable tracking_codes, you get the standard and very unhelpful "invalid request parameters" error.

  2. The names of the specific tracking_codes you intend to use must be registered in the "enterprise settings" ("user settings" tab) of Box' administration pages. The documentation wrongly says that "any name/value pair" can be used, but only names that are pre-registered work. If you use a name that hasn't been registered, you get the unhelpful "invalid request parameters" error.

  3. To set a tracking_code, you update the list of tracking_codes as an attribute. The format of each name/value pair must be: {"type": "tracking_code", "name": "[a name you have registered]", "value": "[any string]"}. So for example, if you've registered "personid" as a valid tracking_code, you can PUT to /2.0/users/[userid] the body

    {"tracking_codes": [{"type": "tracking_code", "name": "personid", "value": "1318231313"}]}
  4. I have not found any way to remove a tracking_code once set. PUT:ing an empty list does nothing. The best possibility seems to be putting an empty string as value for the tracking code, but it is still returned of course.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!