Table of contents

Favorite Items API

The Favorite Items API allows a user to “favorite” individual items

List favorite items

GET /api/data/favorite-items
{
    "favorite_items": [
        {
            "item_id": "5833031d7d551417c16891d475429de3",
            "filename": "Awesome movie.mp4",
            "thumbnail": {
                "height": 100,
                "width": 250,
                "path": "/absolute/path/to/image.jpeg",
                "type": "image",
                "frames": {
                    "count": 0
                }
            },
            "favorited_at": "2016-11-28T00:00:00Z",
        },
        {
            "item_id": "438da31d7d551417c16891d475429de3",
            "filename": "Great-image.jpeg",
            "thumbnail": {
                "height": 100,
                "width": 250,
                "path": "/absolute/path/to/image.jpeg",
                "type": "image",
                "frames": {
                    "count": 0
                }
            },
            "favorited_at": "2016-11-28T00:00:00Z",
        },
    ]
}
  • item_id - (string) The ID of the item
  • filename - (string) Orignial name of file
  • thumbnail - (object) Thumbnail of the first item in the compilation (if at least one item added)
  • favorited_at - (timestamp) date/time item was favorited

Is an item favorited?

Check to see if an specific item is currently “favorited”

GET /api/data/favorite-items/{item_id}

Response

{
    "item_id": "5789031d7d551417c16891d475429de3",
    "is_favorite": true,
}

Favorite/un-favorite an item

Use this single endpoint to toggle favorite on/off for a particular item

POST /api/data/favorite-items/{item_id}
{
    "is_favorite": true/false
}
  • item_id - Required (string) ID of the item to favorite/unfavorite
  • is_favorite = Required (boolean) whether or not item should be favorited

Response

{
    "item_id": "5789031d7d551417c16891d475429de3",
    "is_favorite": true,
}

This documentation is generated from the latest version of GrayMeta Platform. For documentation relevant to your own deployed version, please use the documentation inside the application.