展会信息港展会大全

谷歌眼镜Mirror API Timeline之get方法
来源:互联网   发布日期:2016-01-19 12:37:28   浏览:1867次  

导读:Timeline: get这是从端点返回Timeline item的数据,如果下载时间轴项目的附件内容点这里(mirror attachments get)请求HTTP 请求[HTML]纯文本查看复制代码?01GET [url=https: www googleapis com mirror v ...

Timeline: get这是从端点返回Timeline item的数据,如果下载时间轴项目的附件内容点这里(mirror.attachments.get )

请求

HTTP 请求

[HTML] 纯文本查看 复制代码

?

01

GET [url=https://www.googleapis.com/mirror/v1/timeline/id]https://www.googleapis.com/mirror/v1/timeline/id[/url]

参数

参数名

描述

参数路径

id

string

Timeline Item的id

授权

这个请求需要授权,以下范围的至少有一个(阅读更多关于身份验证和授权read more about authentication and authorization)

Scope

https://www.googleapis.com/auth/Glass.timeline

https://www.googleapis.com/auth/glass.location

请求体

这种方法不提供一个请求主体.

响应

如果成功,这个方法在请求体中返回一个Timeline资源(Timeline resource).

例子:

注意:这个方法可用的代码示例并不代表所有编程语言都支持

Java

使用Java client library

[Java] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23

import com.google.api.services.mirror.Mirror;

import java.io.IOException;

public class MyClass {

// ...

/**

* Delete a timeline item.

*

* @param service Authorized Mirror service.

* @param itemId ID of the timeline item to delete.

*/

public static void deleteTimelineItem(Mirror service, String itemId) {

try {

service.timeline().delete(itemId).execute();

} catch (IOException e) {

System.err.println("An error occurred: " + e);

}

}

// ...

}

.NET

使用.NET client library

[Visual Basic .NET] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

18

19

20

21

22

23

using System;

using Google.Apis.Mirror.v1;

public class MyClass {

// ...

/// <summary>

/// Delete a timeline item.

/// </summary>

/// <param name='service'>Authorized Mirror service.</param>

/// <param name='itemId'>ID of the timeline item to delete.</param>

public static void DeleteTimelineItem(MirrorService service,

String itemId) {

try {

service.Timeline.Delete(itemId).Fetch();

} catch (Exception e) {

Console.WriteLine("An exception occurred: " + e.Message);

}

}

// ...

}

PHP

使用 PHP client library

[PHP] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

11

12

13

/**

* Delete a timeline item.

*

* @param Google_MirrorService $service Authorized Mirror service.

* @param string $itemId ID of the timeline item to delete.

*/

function deleteTimelineItem($service, $itemId) {

try {

$service->timeline->delete($itemId);

} catch (Exception $e) {

print 'An error occurred: ' . $e->getMessage();

}

}

Python

使用Python client library

[Python] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

11

12

13

14

from apiclient import errors

# ...

def delete_timeline_item(service, item_id):

"""Delete a timeline item.

Args:

service: Authorized Mirror service.

item_id: ID of the timeline item to delete.

"""

try:

service.timeline().delete(id=item_id).execute()

except errors.HttpError, e:

print 'An error occurred: %s' % error

Ruby

使用 Ruby client library

[Ruby] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

11

12

13

14

15

16

17

##

# Delete a Timeline Item.

#

# @param [Google::APIClient] client

#Authorized client instance.

# @param [string] item_id

#ID of the timeline item to delete.

# @return nil

def delete_timeline_item(client, item_id)

mirror = client.discovered_api('mirror', 'v1')

result = client.execute(

:api_method => mirror.timeline.delete,

:parameters => { 'id' => item_id })

if result.error?

puts "An error occurred: #{result.data['error']['message']}"

end

end

Go

使用Go client library

[C] 纯文本查看 复制代码

?

01

02

03

04

05

06

07

08

09

10

11

12

13

import (

"code.google.com/p/google-api-go-client/mirror/v1"

"fmt"

)

// DeleteTimelineItem deletes a timeline item.

func DeleteTimelineItem(g *mirror.Service, itemId string) error {

err := g.Timeline.Delete(itemId).Do()

if err != nil {

fmt.Printf("An error occurred: %v\n", err)

}

return err

}

Raw HTTP

使用 Raw HTTP client library

[HTML] 纯文本查看 复制代码

?

01

02

03

DELETE /mirror/v1/timeline/timeline item id HTTP/1.1

Host: [url=http://www.googleapis.com]www.googleapis.com[/url]

Authorization: Bearer auth token

赞助本站

人工智能实验室

相关热词: get方法 谷歌眼镜 android

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港