Skip to content

Commit 8759202

Browse files
committed
feat: add support for bookmarks
closes #44
1 parent ec48e4b commit 8759202

File tree

2 files changed

+133
-99
lines changed

2 files changed

+133
-99
lines changed

doc/web-links.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,55 @@
11
# Web Links
22

3-
Web link objects represent a web link (bookmark) from a user's account. They can perform common web link operations, like create, read, update, and delete.
3+
Represents a web link (bookmark) on Box
44

55
## Get a Web Link's Information
66

7-
Calling `getWebLinkInfo()` on a web link returns a snapshot of the web link's info.
8-
97
```java
108
BoxWebLink webLink = new BoxWebLink(api, 'web-link-id');
119
BoxWebLink.Info info = webLink.getWebLinkInfo();
1210
```
1311

14-
## Update a Web Link's Information
12+
## Create a Web Link
13+
14+
```java
15+
BoxWebLink webLink = new BoxWebLink(api, null);
16+
BoxWebLink.Info info = new BoxWebLink.Info('{"url":"https://www.salesforce.com/", "parent": {"id": "0"}, "name": "Salesforce", "description": "Link to Salesforce"}');
17+
BoxWebLink.Info created = webLink.createWebLink(info);
18+
```
1519

16-
Updating a web link's information is done by creating a new `BoxWebLink.Info` object or updating an existing one, and then calling `updateWebLinkInfo(BoxWebLink.Info)`.
20+
## Update a Web Link's Information
1721

1822
```java
19-
BoxWebLink webLink = new BoxWebLink(api, '12303730068');
23+
BoxWebLink webLink = new BoxWebLink(api, 'web-link-id');
2024
BoxWebLink.Info info = webLink.getWebLinkInfo();
21-
info.addValue('description', 'Some web link I made');
25+
info.addValue('description', 'a descriptive description');
2226
BoxWebLink.Info updated = webLink.updateWebLinkInfo(info);
2327
```
2428

2529
## Delete a Web Link
2630

27-
A web link can be deleted with the `deleteWebLink()` method.
28-
2931
```java
3032
BoxWebLink webLink = new BoxWebLink(api, 'web-link-id');
3133
webLink.deleteWebLink();
3234
```
35+
36+
## Get a Trashed Web Link's Information
37+
38+
```java
39+
BoxWebLink webLink = new BoxWebLink(api, 'web-link-id');
40+
BoxWebLink.Info info = webLink.getTrashedWebLinkInfo();
41+
```
42+
43+
## Restore a Trashed Web Link
44+
45+
```java
46+
BoxWebLink webLink = new BoxWebLink(api, 'web-link-id');
47+
BoxWebLink.Info info = webLink.restoreTrashedWebLink();
48+
```
49+
50+
## Permanently Delete a Web Link
51+
52+
```java
53+
BoxWebLink webLink = new BoxWebLink(api, 'web-link-id');
54+
webLink.permanentlyDeleteWebLink();
55+
```

0 commit comments

Comments
 (0)