Help Search

Add a resource to favorites

To add a resource to your favorite list:

POST /favorites/resource/<resourceId>.json?api-version=v2

Possible responses

Code Description
200 OK
Request went through. Given resource has been added to favorite
400 Bad Request
  1. If the given resourceId is not a uuid
  2. Given resource is alredy added to favorite
403 Authentication Failure
The user making the request is not authenticated
404 Not Found
  1. if the resource does not exist
  2. if the resource is deleted
  3. if the user does not have access to the resource

Response examples

Success

Upon success this will return a json response like below

{
    "header": {
        "id": "0bade2b5-db54-4537-872e-b82f33dee3e6",
        "status": "success",
        "servertime": 1555055916,
        "title": "app_favorites_add_success",
        "action": "0ed6c4a8-8c1f-52c6-9859-67f37794a02e",
        "message": "The resource was marked as favorite.",
        "url": "/favorites/resource/4d7adb92-0d85-56d7-8b92-e2b919ef8eb8.json?api-version=v2",
        "code": 200
    },
    "body": {
        "user_id": "f848277c-5398-58f8-a82a-72397af2d450",
        "foreign_key": "4d7adb92-0d85-56d7-8b92-e2b919ef8eb8",
        "foreign_model": "Resource",
        "created": "2019-04-12T07:58:36+00:00",
        "modified": "2019-04-12T07:58:36+00:00",
        "id": "288050d2-25b0-4c04-a959-2fc6f4011208"
    }
}

Last updated

This article was last updated on April 23rd, 2019.

If you are familiar with the high level API concepts and only looking for the endpoint implementation details, there is a repository with the latest OpenAPI 2.0 specifications (compatible with Swagger).

OpenAPI Specs