添加新设备时的服务器错误导致重复设备

Server error upon adding new device leads to duplicate devices

TL;DR -

我在 Xively 中错误地创建了大量重复的设备。如何仅使用我的浏览器删除它们?或者我需要编写 Perl 脚本吗?


我刚刚开通了一个新的 Xively 个人账户,运行 通过了试驾

在第 2 步后

我添加了一个新设备

单击添加设备 后,我收到服务器错误

经过反复尝试(点击浏览器的后退按钮再试),我点击了页面顶部的开发 link,结果是显示多个重复设备:

如果我点击一个设备,打开它的 Workbench,我会收到另一个服务器错误(注意 URL 与第一个不同):

当前是否存在服务器错误 - Twitter 提要中没有提及服务器宕机?如何删除或编辑重复的设备?有没有办法管理它们?我似乎无法找到 link 来联系支持台。真的有可用的支持台吗?

我的帐户现在“毁了”吗?我应该放弃它并开设一个新帐户吗?

P.S。当我通过 VPN 运行 添加设备时(OS X 上的 TunnelBlick),但这肯定不会导致问题..?


我已尝试按照 Delete a Device 中的信息进行操作:

Method DELETE

Base URL https://api.xively.com

API Endpoint /v2/products/PRODUCT_ID/devices/SERIAL_NUMBER

但是我不知道PRODUCT_ID是什么,我只是猜测SERIAL_NUMBER是设备末尾的代码URL?

  1. 点击其中一个重复的设备获取设备URL(即使它仍然导致服务器错误页面):https://personal.xively.com/develop/sfStgqRmlqymGIFeHleB
  2. 形成删除URL: https://api.xively.com/v2/products/PRODUCT_ID/devices/sfStgqRmlqymGIFeHleB
  3. 登录确认删除操作后,收到消息

{"title":"Not found","errors":"Couldn't find Product with product_id = PRODUCT_ID"}

如何发现 PRODUCT_ID?


所以,从 List All Products:

Method GET

Base URL https://api.xively.com

API Endpoint /v2/products

我用了URL: https://api.xively.com/v2/products

我得到了我所有产品的列表,这些产品实际上是重复的设备,以及一系列不同的 PRODUCT_ID。 (设备有 PRODUCT_IDs 而不是设备 SERIAL_NUMBERs 似乎有点奇怪):

{"totalResults":7,"products":[{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"sfStgqRmlqymGIFeHleB","secret":"41aad0ab3fec62efd94fc7d54f77a911f232522d","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"},{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"luXVnI1ymGHW4SonH-37","secret":"e923aad16dce33e6635e7a8620243110ba93e9cc","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"},{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"4NV5BvCmx54q84AcVCLB","secret":"13e624cececcecf9af6e558874cdf78e65049fe8","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"},{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"l8S8kBZWWG_s1YRrytwW","secret":"5a476bc550055d8ab7dc7c72ceb0433fd39e451f","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"},{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"jWWRuW_JhkXqKUA0F769","secret":"b3a5d78b51dca5d3ef56268141e7c25c8d00a61a","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"},{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"3nXDH0DV6z3_y5cr47qA","secret":"7793d8607194fec4a7e85c0091df93642fc68069","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"},{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"TWF2T_IXpS7sDZxSlc2f","secret":"9f03403167b467ec7fec295c87c6260b3a4074cc","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"}]}

Delete a Product开始:

Method DELETE

Base URL https://api.xively.com

API Endpoint /v2/products/PRODUCT_ID

我创建了 URL https://api.xively.com/v2/products/TWF2T_IXpS7sDZxSlc2f

其中 TWF2T_IXpS7sDZxSlc2f 是上面生成的产品列表中的最后一个 PRODUCT_ID。但是,这只是 returns PRODUCT_ID:

的数据
{"product":{"description":"A sPhone by Smapple","name":"SplunkinsPhone","product_id":"TWF2T_IXpS7sDZxSlc2f","secret":"9f03403167b467ec7fec295c87c6260b3a4074cc","state":"develop","devices_count":0,"activated_devices_count":0,"feed_defaults":{"title":"SplunkinsPhone","private":"true"},"user":"splunkins"}}

现在的问题是如何通过我的浏览器执行 DELETE 方法,因为 URL 只是一个 GET 并且基本上是执行一个 Read a Product 而不是一个删除?

答案是,对每个 PRODUCT_ID 递归地使用 curl

curl -X DELETE 'api.xively.com/v2/products/3nXDH0DV6z3_y5cr47qA' -u 'username:password'