03 device.json (1/2)

  {
    "title": "Mock Library",
    "description": "Test catalog with sign-in, shelves and search.",
  
    "config": { "file": "config.json" },
    "token":  { "file": "token.json", "path": "token" },
  
    "auth": {
      "type": "password",
      "request": {
        "url": "{cfg.server}/oauth/token",
        "method": "POST",
        "headers": { "Content-Type": "application/json" },
        "body": "{\"username\":\"{cfg.username}\",\"password\":\"{cfg.password}\"}"
      },
      "token_path": "access_token"
    },
  
    "browse": {
      "url": "{cfg.server}/api/books?shelf={list_id_enc}&offset={offset}&limit={limit}",
      "headers": { "Authorization": "Bearer {token}" },
      "items": "items",
      "page_size": 8,
      "fields": {
        "title": "title",
        "author": "author",
        "id": "id",
        "description": "summary"
      },
      "lists": [
        { "title": "All books", "id": "" }
      ],
      "lists_url": "{cfg.server}/api/shelves",
      "lists_headers": { "Authorization": "Bearer {token}" },
      "lists_items": "shelves",
      "lists_fields": { "title": "name", "id": "id" },
      "search": {
        "url": "{cfg.server}/api/books?q={query}&offset={offset}&limit={limit}"
      }
    },
  
    "download": {
      "url": "{cfg.server}/api/books/{id_enc}/download",
      "method": "POST",
      "headers": { "Authorization": "Bearer {token}", "Content-Type": "application/json" },
      "body": "{}",
      "url_path": "url",
‹ PreviousReader file (.txt)Next ›