ASH.ResourceLibrary.WebApi

<back to all web services

FavoritesRequest

Requires Authentication
The following routes are available for this service:
GET,POST/favoritesUse to get a list Resource Items
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BasicResourceLibraryRequest:
    resource_library_member_id: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Tag:
    id: Optional[str] = None
    title: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ScreenshotItem:
    large_filepath_s3: Optional[str] = None
    thumb_filepath_s3: Optional[str] = None
    order: Optional[Decimal] = None
    description: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceCard:
    id: Optional[str] = None
    title: Optional[str] = None
    description: Optional[str] = None
    description_summary: Optional[str] = None
    type: Optional[str] = None
    content: Optional[str] = None
    is_complete: Optional[bool] = None
    is_favorite: Optional[bool] = None
    is_implicitly_complete: Optional[bool] = None
    media_path: Optional[str] = None
    is_confirmable: Optional[bool] = None
    is_wcag_compliant: Optional[bool] = None
    duration: Optional[str] = None
    preview: Optional[str] = None
    calories: Optional[int] = None
    instructor: Optional[str] = None
    thumbnail: Optional[str] = None
    difficulty: Optional[str] = None
    tags: Optional[List[Tag]] = None
    subtitles: Optional[str] = None
    screenshots: Optional[List[ScreenshotItem]] = None
    drm_encrypted: Optional[bool] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Meta:
    resource_count: Optional[int] = None
    title: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ResourceItemsLiteResponse(IResourceItemsLiteResponse):
    resource_items: Optional[List[ResourceCard]] = None
    meta: Optional[Meta] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class FavoritesRequest(BasicResourceLibraryRequest):
    # @ApiMember(Description="Set it to true if requesting saved resources only from digital library")
    digital_fitness: Optional[bool] = None
    """
    Set it to true if requesting saved resources only from digital library
    """


    # @ApiMember(Description="Set it to true if requesting saved resources only from health library")
    health_library: Optional[bool] = None
    """
    Set it to true if requesting saved resources only from health library
    """


    # @ApiMember(Description="Set it to true if requesting saved resources only from vptr")
    vptr: Optional[bool] = None
    """
    Set it to true if requesting saved resources only from vptr
    """


    # @ApiMember(Description="Set it to true if requesting saved resources only from wellbeing")
    wellbeing: Optional[bool] = None
    """
    Set it to true if requesting saved resources only from wellbeing
    """


    # @ApiMember(Description="Set it to true if requesting saved resources only from health")
    health: Optional[bool] = None
    """
    Set it to true if requesting saved resources only from health
    """


    limit: Optional[str] = None
    offset: Optional[str] = None

Python FavoritesRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /favorites HTTP/1.1 
Host: resourcelibrary.api.ashcompanies.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"digitalFitness":false,"healthLibrary":false,"vptr":false,"wellbeing":false,"health":false,"limit":"String","offset":"String","resourceLibraryMemberId":0}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"resourceItems":[{"id":"String","title":"String","description":"String","descriptionSummary":"String","type":"String","content":"String","isComplete":false,"isFavorite":false,"isImplicitlyComplete":false,"mediaPath":"String","isConfirmable":false,"isWcagCompliant":false,"duration":"String","preview":"String","calories":0,"instructor":"String","thumbnail":"String","difficulty":"String","tags":[{"id":"String","title":"String"}],"subtitles":"String","screenshots":[{"largeFilepathS3":"String","thumbFilepathS3":"String","order":0,"description":"String"}],"drmEncrypted":false}],"meta":{"resourceCount":0,"title":"String"}}