๐Ÿ“ฆ directus / v6-archive

๐Ÿ“„ get-user-bookmarks.md ยท 64 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64# Get User Bookmarks

<span class="request">`GET` **/api/1.1/bookmarks/self**</span>

<span class="description">Get all of the bookmarks for the current user</span>

### Example Request

```bash
$ curl https://instance--key.directus.io/api/1.1/bookmarks/self \
  -u [user-token]:
```

```php
// Using the SDK with API connection
// you can fetch bookmarks same as get bookmarks method
$bookmarks = $client->getBookmarks();

// Using the SDK with DB connection you can fetch any bookmarks
// So you `1` here is the user id.
$bookmarks = $client->getBookmarks(1);
```

```javascript
client.getUserBookmarks();
```

## Response

<span class="attributes">Attribute</span> | Description
--------|------------
**meta** _Meta Object_ | The Directus system metadata object that provides useful information not contained within the dataset itself [**Meta Object**: View Nested Attributes](/overview/objects-model.md#meta-object)
**data** _Bookmark Object Collection_ | <span class="custom">This data and its architecture is based on Directus bookmarks's schema</span> [**Bookmark Object**: View Nested Attributes](/overview/objects-model.md#bookmark-object)

### Example Response

```json
{
  "meta": {
    "table": "directus_bookmarks",
    "type": "collection",
    "total": 2,
  },
  "data": [{
      "id": 1,
      "user": 1,
      "title": "Draft Articles",
      "url": "tables/articles/pref/Draft Articles",
      "icon_class": null,
      "active": null,
      "section": "search"
    },
    {
      "id": 2,
      "user": 1,
      "title": "Published News",
      "url": "tables/news/pref/Published News",
      "icon_class": null,
      "active": null,
      "section": "search"
    }]
}
```