根据文档https://one.ubuntu.com/developer/files/store_files/cloud,我应该能够使用'https://one.ubuntu.com/api/file_storage/v1/~/Ubuntu一”,但暂时更名为“https://files.one.ubuntu.com/~/Ubuntu一”。我没有收到任何回应,尽管我的访问令牌成功了,并且我能够获得:
object(stdClass)[230]
public 'visible_name' => string 'Username'
public 'root_node_path' => string '/~/Ubuntu One' (length=13)
public 'user_node_paths' =>
array (size=0)
empty
public 'resource_path' => string '' (length=0)
public 'user_id' => int number
public 'max_bytes' => int number
public 'used_bytes' => int number
是服务器还是我的账户有问题?
答案1
您需要传递 include_children=true 的查询字符串来查看 Ubuntu One 文件夹的内容。
作为参考,当我向https://one.ubuntu.com/api/file_storage/v1/~/Ubuntu%20One这是我收到的 JSON:
{
"kind": "directory",
"when_created": "2009-02-11T15:33:10Z",
"generation": 12592,
"has_children": true,
"content_path": "/content/~/Ubuntu One",
"generation_created": 0,
"parent_path": null,
"is_live": true,
"resource_path": "/~/Ubuntu One",
"when_changed": "2013-01-23T15:56:45Z",
"key": "(removed)",
"path": "/",
"volume_path": "/volumes/~/Ubuntu One"
}