• Register

Penguin Random House Developer Blog

Enhanced API v1.1.7 released

On Thursday October 8, 2015, version 1.1.7 of the Enhanced PRH API was released to production. There were several bug fixes along with some enhancements for handling multiple authors and displaying series data.

If you encounter any problems with your applications as a result of these changes, please contact us at api@penguinrandomhouse.com.

Version 1.1.7 release notes

Enhancements to handle multiple authors

Even though SAP, our system of record, will have just a single author ID for a person (8240 Janet Evanovich), MyHouse may need to create a separate author ID for distribution clients to be able to attach their own content to (223351 Janet Evanovich). This distinction between core and distribution is captured in the field companyCode which is now exposed as part of the author representation. Further, the distribution author records reference the parent record from which they were created with the field clientSourceId.

/domains/PRH.US/authors/8240

        "authorId": 8240,
        "display": "Janet Evanovich",
        "first": "Janet",
        "last": "Evanovich",
        "company": {
          "key": "R_H",
          "value": null
        },
        "clientSourceId": 0,
        "seoFriendlyUrl": "\/authors\/8240\/janet-evanovich",

In addition the author-display view of the author resource has been expanded to include nested representations of the client authors when the core author is accessed.

/domains/PRH.US/authors/8240/views/author-display

    "authorId": 8240,
    "display": "Janet Evanovich",
    ...
    "company": {
      "key": "R_H",
      "value": null
    },
    "clientSourceId": 0,
    "clientAuthors": {
      "223351": {
        "authorId": 223351,
        "display": "Janet Evanovich",
        "ontour": false,
        "spotlight": null,
        "hasAuthorPhoto": false,
        "photoCredit": null,
        "photoDate": null,
        "firstInitial": "J",
        "lastInitial": "E",

Search was also modified to accommodate this distinction. Author documents now have the field "companyCode" which is either the text "R_H" or a distribution client's two-character division code. The search endpoint exposes the new parameter companyCode to allow PRH.com to restrict search results to just core authors (e.g. 8240 Janet Evanovich) and exclude the distribution versions of those same authors (e.g. 223351 Janet Evanovich).

Enhancements to series data

To support PRH.com development on series pages, new functionality was added around returning series data. We are now computing a number of properties of a series at load time including a series date, whether the series is numbered or not, and works that can represent the series. This data is now returned as part of the series representation.

/domains/PRH.US/series/SOO

        "seriesCode": "SOO",
        "seriesName": "A Song of Ice and Fire",
        "description": "<b>An immersive entertainment experience unlike any other, A Song of Ice and Fire has earned George R. R. Martin&mdash;dubbed &ldquo;the American Tolkien&rdquo; by <i>Time<\/i> magazine&mdash;international acclaim and millions of loyal readers.<\/b><br><br> In a land where summers can last decades and winters a lifetime, trouble is brewing. The cold is returning, and in the frozen wastes to the North of Winterfell, sinister and supernatural forces are massing beyond the kingdom&rsquo;s protective Wall. At the center of the conflict lie the Starks of Winterfell, a family as harsh and unyielding as the land they were born to. Sweeping from a land of brutal cold to a distant summertime kingdom of epicurean plenty, here is a tale of lords and ladies, soldiers and sorcerers, assassins and bastards, who come together in a time of grim omens. Amid plots and counterplots, tragedy and betrayal, victory and terror, the fate of the Starks, their allies, and their enemies hangs perilously in the balance, as each endeavors to win that deadliest of conflicts: the game of thrones.<br><br> <b>Praise for A Song of Ice and Fire<\/b><br><br> &ldquo;One of the best series in the history of fantasy.&rdquo;<b>&mdash;<i>Los Angeles Times<\/i><\/b><br><br> &ldquo;Long live George Martin . . . a literary dervish, enthralled by complicated characters and vivid language, and bursting with the wild vision of the very best tale tellers.&rdquo;<b><i>&mdash;The New York Times<\/i><\/b><br><br> &ldquo;The only fantasy series I&rsquo;d put on a level with J.R.R. Tolkien&rsquo;s The Lord of the Rings . . . a fantasy series for hip, smart people, even those who don&rsquo;t read fantasy.&rdquo;<b>&mdash;<i>Chicago Tribune<\/i><\/b><br><br> &ldquo;Martin has produced&mdash;is producing, since the series isn&rsquo;t over&mdash;the great fantasy epic of our era.&rdquo;<b>&mdash;Lev Grossman, <i>Time<\/i><\/b><br>",
        "seriesCount": 3,
        "seriesDate": "2015-10-06",
        "isNumbered": true,
        "isKids": false,
        "seoFriendlyUrl": "\/series\/SOO\/a-song-of-ice-and-fire",

In addition we recognized that sometimes exploding a series into its component ISBNs and selecting all of its authors or categories resulted in less than perfect results. For example there is a single ISBN in the "Little Golden Book" series that has the Young Adult consumer category even though that is not really representative of the series as a whole. So at load time we are identifying at most two authors to be considered the series authors and one representative work to serve as the source for the series' categories. This data is returned as part of the extended representation in the series-display view.

/domains/PRH.US/series/SOO/views/series-display

    "seriesCode": "SOO",
    "seriesName": "A Song of Ice and Fire",
    "description": "<b>An immersive entertainment experience unlike any other, A Song of Ice and Fire has earned George R. R. Martin&mdash;dubbed &ldquo;the American Tolkien&rdquo; by <i>Time<\/i> magazine&mdash;international acclaim and millions of loyal readers.<\/b><br><br> In a land where summers can last decades and winters a lifetime, trouble is brewing. The cold is returning, and in the frozen wastes to the North of Winterfell, sinister and supernatural forces are massing beyond the kingdom&rsquo;s protective Wall. At the center of the conflict lie the Starks of Winterfell, a family as harsh and unyielding as the land they were born to. Sweeping from a land of brutal cold to a distant summertime kingdom of epicurean plenty, here is a tale of lords and ladies, soldiers and sorcerers, assassins and bastards, who come together in a time of grim omens. Amid plots and counterplots, tragedy and betrayal, victory and terror, the fate of the Starks, their allies, and their enemies hangs perilously in the balance, as each endeavors to win that deadliest of conflicts: the game of thrones.<br><br> <b>Praise for A Song of Ice and Fire<\/b><br><br> &ldquo;One of the best series in the history of fantasy.&rdquo;<b>&mdash;<i>Los Angeles Times<\/i><\/b><br><br> &ldquo;Long live George Martin . . . a literary dervish, enthralled by complicated characters and vivid language, and bursting with the wild vision of the very best tale tellers.&rdquo;<b><i>&mdash;The New York Times<\/i><\/b><br><br> &ldquo;The only fantasy series I&rsquo;d put on a level with J.R.R. Tolkien&rsquo;s The Lord of the Rings . . . a fantasy series for hip, smart people, even those who don&rsquo;t read fantasy.&rdquo;<b>&mdash;<i>Chicago Tribune<\/i><\/b><br><br> &ldquo;Martin has produced&mdash;is producing, since the series isn&rsquo;t over&mdash;the great fantasy epic of our era.&rdquo;<b>&mdash;Lev Grossman, <i>Time<\/i><\/b><br>",
    "seriesDate": "2015-10-06",
    "count": 3,
    "isNumbered": true,
    "isKids": false,
    "work1": {
      "workId": 108336,
      "title": "A Game of Thrones",
      "author": "George R. R. Martin",
      "onsale": "1996-08-01",
      "frontlistiest": 9780553386790,
      "seoFriendlyUrl": "\/books\/108336\/a-game-of-thrones-by-george-r-r-martin"
    },
    "work2": {
      "workId": 108335,
      "title": "A Feast for Crows",
      "author": "George R. R. Martin",
      "onsale": "2005-11-08",
      "frontlistiest": 9780553390575,
      "seoFriendlyUrl": "\/books\/108335\/a-feast-for-crows-by-george-r-r-martin"
    },
    "work3": {
      "workId": 108334,
      "title": "A Dance with Dragons",
      "author": "George R. R. Martin",
      "onsale": "2011-07-12",
      "frontlistiest": 9781101886045,
      "seoFriendlyUrl": "\/books\/108334\/a-dance-with-dragons-by-george-r-r-martin"
    },
    "featured": null,
    "authors": [
      {
        "authorId": 233901,
        "display": "George R. R. Martin",
        "first": "George R. R.",
        "last": "Martin",
        "seoFriendlyUrl": "\/authors\/233901\/george-r-r-martin",
        "photocredit": null,
        "photoDate": null,
        "firstInitial": "G",
        "lastInitial": "M",
        "hasAuthorPhoto": false,
        "coverIsbn": 9780345533487
      }
    ],
    "categories": [
      {
        "catId": 2000000011,
        "description": "Art",
        "catUri": "\/art",
        "seq": 2
      },
      {
        "catId": 2000000059,
        "description": "Film",
        "catUri": "\/film",
        "seq": 3
      },
      {
        "catId": 2000000061,
        "description": "Games",
        "catUri": "\/games",
        "seq": 1
      },
      {
        "catId": 2000000116,
        "description": "Performing Arts",
        "catUri": "\/performing-arts",
        "seq": 4
      }
    ],
    "seoFriendlyUrl": "\/series\/SOO\/a-song-of-ice-and-fire",

Bug

  • [RHAPI-292] - /series/BPO/views/series-display generates NPE
  • [RHAPI-297] - Error fetching work details without domain
  • [RHAPI-298] - list works record count is wrong
  • [RHAPI-300] - Error listing category sets
  • [RHAPI-301] - Incorrect "icon" URL for authors
  • [RHAPI-312] - Work product display view ISBNs not in frontlistiest order within format

New Feature

  • [RHAPI-314] - Could we get the on sale date included in the featured hash of the series-display view

Task

  • [RHAPI-304] - Expose AUTHOR.CLIENT_SOURCE_ID in author representation
  • [RHAPI-305] - Add "companyCode" parameter to /search
  • [RHAPI-309] - Add seriesCount to Search Display View
  • [RHAPI-310] - Add division description to author representation
  • [RHAPI-315] - Add seriesName and seriesNumber to work list display