我错误地在Xively中创建了大量重复设备。如何仅使用我的浏览器删除它们?或者我需要编写Perl脚本吗?
我刚刚开设了一个新的Xively个人帐户,并且正在浏览试用版。
在第2步
我添加了一个新设备
点击添加设备后,收到服务器错误
经过多次尝试(点击浏览器的后退按钮并再次尝试),我点击页面顶部的开发链接,只显示多个重复的设备:
如果我点击某个设备,要打开其工作台,我会收到另一个服务器错误(请注意该网址与第一个不同):
目前是否存在服务器错误 - 没有提到关于Twitter Feed中服务器关闭的问题?如何删除重复的设备或编辑它们?有办法管理它们吗?我似乎无法找到联系支持台的链接。实际上是否有支持服务台?
我的帐户现在“毁了”吗?我应该把它作为一个糟糕的工作放弃并开设一个新帐户吗?
P.S。当我添加设备时,我正在通过VPN(OS X上的TunnelBlick)运行,但这肯定不会导致问题..?
我尝试过关注Delete a Device的信息:
方法DELETE
API Endpoint / v2 / products / PRODUCT_ID / devices / SERIAL_NUMBER
但我不知道PRODUCT_ID
是什么,我只是猜测SERIAL_NUMBER
是设备网址末尾的代码?
{“title”:“未找到”,“错误”:“无法找到带有product_id = PRODUCT_ID的产品”}
如何发现PRODUCT_ID?
所以,来自List All Products:
方法GET
API Endpoint / v2 / products
我使用了以下网址: https://api.xively.com/v2/products
我得到了所有产品的列表,其实际上是重复的设备,以及一系列不同的PRODUCT_ID
。 (设备有PRODUCT_ID而不是设备SERIAL_NUMBER
)似乎有点奇怪:
{"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
API Endpoint / v2 / products / PRODUCT_ID
我创建了URL https://api.xively.com/v2/products/TWF2T_IXpS7sDZxSlc2f
TWF2T_IXpS7sDZxSlc2f
是上面生成的产品列表中的最后一个PRODUCT_ID
。但是,这只会返回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方法,因为网址只是GET
,基本上是执行Read a Product而不是删除
答案 0 :(得分:0)
答案是,对每个PRODUCT_ID
递归,使用curl
curl -X DELETE 'api.xively.com/v2/products/3nXDH0DV6z3_y5cr47qA' -u 'username:password'