• Register

Multiple authors

You may discover that we have multiple author IDs within the API database that represent the same person. This is not a mistake but it does cause some confusion and can create problems for clients not aware of it. This document will explain why multiple author records exist and how you can work with them.

Why multiple IDs

Author IDs are assigned within SAP, our system of record, and a significant effort is made to ensure that there is no unnecessary duplication of authors at that level. The data is then extracted to our content management system, MyHouse, where information like author biographies and photos can be attached. In cases where an author contributes to books by both a core PRH division and by one of our distribution clients, MyHouse creates a separate author ID so that our distribution clients have the opportunity to attach their own content to that ID. This is why there are two Janet Evanovich author records in our system.

/domains/PRH.US/authors?authorId=8240&authorId=223351

      {
        "authorId": 8240,
        "display": "Janet Evanovich",
        "first": "Janet",
        "last": "Evanovich",
        "company": {
          "key": "R_H",
          "value": null
        },
        "clientSourceId": 0,
        "seoFriendlyUrl": "\/authors\/8240\/janet-evanovich",
        "contribRoleCode": null,
        "contribRoleDesc": null,
        "_embeds": null,
        "_links": [
          
        ]
      },
      {
        "authorId": 223351,
        "display": "Janet Evanovich",
        "first": "Janet",
        "last": "Evanovich",
        "company": {
          "key": "EK",
          "value": "Dark Horse Comics"
        },
        "clientSourceId": 8240,
        "seoFriendlyUrl": "\/authors\/223351\/janet-evanovich",
        "contribRoleCode": null,
        "contribRoleDesc": null,
        "_embeds": null,
        "_links": [
          
        ]
      }

 

The 8240 record is the core PRH version while the 223351 is the Dark Horse Comics version.

So in the source system there was just 8240 but the content management system created 223351 as a copy of 8240. Fortunately a trail is created when the copy is made and it is that trail that we'll follow as we try to understand which is which.

Identifying author records

We recently enhanced the /authors endpoint by adding two additional elements, company and clientSourceId.

For core authors, that is author IDs that were assigned in SAP, the company.key will always be "R_H" (a legacy of when this was implemented for Random House) and the clientSourceId will always be zero. We can see from these values on the 8240 Janet Evanovich record that it is the one we would expect to be associated with Bantam Dell titles or the titles of other core PRH divisions.

        "company": {
          "key": "R_H",
          "value": null
        },
        "clientSourceId": 0

 

For distribution authors, that is author IDs that were created within the content management system as copies of core authors, the company.key will be a division code and company.value will be the division description. Further, the clientSourceId will reference the ID of the core author ID from which it was copied. We can see from the values on the 223351 Janet Evanovich record that it was created for Dark Horse Comics and that it was references the 8240 record.

        "company": {
          "key": "EK",
          "value": "Dark Horse Comics"
        },
        "clientSourceId": 8240,

 

How PRH.com uses company and clientSourceId

PRH.com wanted a single author detail page. Excluding the distribution client versions of the authors was not an option because that would require excluding the titles they needed the titles on the site. Instead we came up with a solution that focused on two parts: redirecting requests for distribution client authors to their core equivalents and then enhancing the core author displays to include information about their distribution client children.

Whenever a request is made for an author detail page on PRH.com, the web side checks the value of the clientSourceId that is returned from the API request for that author's details. If it is zero, then it knows that the requested author is core and it continues displaying the page. However if it is not zero, then it interrupts the processing and issues a redirect (302) to the author detail page with that ID. So in other words a request for http://www.penguinrandomhouse.com/authors/223351 is redirected to http://www.penguinrandomhouse.com/authors/8240/janet-evanovich.

Redirecting to the core author page gives us a single landing page for the author however we now need to ensure that all of the content associated with that author is represented, including their titles published with distribution clients. This is achieved by an extension we made to the author display view. We added the element clientAuthors which actually returns embedded copies of the same author display structure but for any author IDs it finds that use the requested ID as its clientSourceId. In other words, all of the records that are children of the core author are embedded in the response.

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

"clientAuthors": {
      "223351": {
        "authorId": 223351,
        "display": "Janet Evanovich",
        "ontour": false,
        "spotlight": null,
        "hasAuthorPhoto": false,
        "photoCredit": null,
        "photoDate": null,
        "firstInitial": "J",
        "lastInitial": "E",
        "events": [
          
        ],
        "essays": [
          
        ],
        "relatedLinks": [
          
        ],
        "works": [
          {
            "id": 242489,
            "name": "Troublemaker: A Barnaby and Hooker Graphic Novel",
            "isbn": 9781595827227,
            "subtitle": null,
            "format": "Paperback",
            "onsale": "2011-07-19",
            "price": 16.99,
            "pages": 112,
            "trim": "6 x 9",
            "isbnDisplay": "978-1-59582-722-7",
            "series": null,
            "imprint": "Dark Horse Books",
            "flapCopy": "Barney and Hooker are together again and fighting crime, leaving a trail of chaos, panic, and disorder in their wake. Some would say they're drawn toward trouble like a moth to a flame. Others would claim their friends, Rosa and Felicia, dump trouble in Barney's and Hooker's laps. Either way, they are in over their heads when Rosa is kidnapped, and her disappearance is linked to a dangerous voodoo priest and his search for a mystery-drenched stolen statue.<br><br>Written by Janet and Alex Evanovich, and illustrated by Jo&#235;lle Jones (<i>Dr. Horrible<\/i>, <i>Token<\/i>), <i>Troublemaker<\/i> brings ultimate adventure set in sun-filled Miami!<br><br>&#8226; Janet Evanovich, the <i>New York Times<\/i> number-one best-selling author, brings her hit Barnaby series to Dark Horse Comics!<br><br>&#8226; The entire <i>Troublemaker<\/i> story collected into one affordable volume!<br><br>&#8226; \"With art reminiscent of the Florida sun and writing supercharged with action, the <i>Troublemaker<\/i> graphic novel from best-selling author Evanovich and her daughter is a winner!\"&amp;mdash;RT Book Reviews",
            "authors": [
              {
                "authorId": 223349,
                "display": "Alex Evanovich",
                "firstInitial": "A",
                "lastInitial": "E",
                "roleCode": "A",
                "roleName": "Author",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/223349\/alex-evanovich",
                "attr": null
              },
              {
                "authorId": 223351,
                "display": "Janet Evanovich",
                "firstInitial": "J",
                "lastInitial": "E",
                "roleCode": "A",
                "roleName": "Author",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/223351\/janet-evanovich",
                "attr": null
              },
              {
                "authorId": 2074218,
                "display": "Various",
                "firstInitial": null,
                "lastInitial": "V",
                "roleCode": "I",
                "roleName": "Illustrator",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/2074218\/various",
                "attr": null
              },
              {
                "authorId": 221834,
                "display": "Dan Jackson",
                "firstInitial": "D",
                "lastInitial": "J",
                "roleCode": "I",
                "roleName": "Illustrator",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/221834\/dan-jackson",
                "attr": null
              }
            ],
            "formats": [
              {
                "format": "Paperback",
                "count": 4
              }
            ],
            "seoFriendlyUrl": "\/books\/242489\/troublemaker-a-barnaby-and-hooker-graphic-novel-by-evanovich-alex"
          },
          {
            "id": 241575,
            "name": "Troublemaker Book 2",
            "isbn": 9781595825735,
            "subtitle": null,
            "format": "Hardcover",
            "onsale": "2010-11-23",
            "price": 17.99,
            "pages": 112,
            "trim": "6 x 9",
            "isbnDisplay": "978-1-59582-573-5",
            "series": null,
            "imprint": "Dark Horse Books",
            "flapCopy": "There's no smooth sailing for Alex Barnaby and Sam Hooker in the second volume of bestselling author Janet Evanovich's graphic-novel adventure, Troublemaker.<br>Barnaby, Hooker, Rosa, Felicia, and Beans the St. Bernard set sail to the Florida Keys in order to find the wooden body of Baron Samedi that matches their recently acquired &#8212; and stolen &#8212; wooden hand. But in the world of petro voodoo a hand for a hand and a Baron for a boat is fair play. When the Happy Hooker disappears from its mooring in the Keys, Barnaby and Hooker have to find a way back to Miami with the stolen body of Baron Samedi. Ransom notes for the Happy Hooker, a sack of snakes, and a ticked-off chicken, leave only one place safe enough to hide a body... Hooker's mom's house &#8212; a situation that makes the sack of snakes look like chump change.",
            "authors": [
              {
                "authorId": 223351,
                "display": "Janet Evanovich",
                "firstInitial": "J",
                "lastInitial": "E",
                "roleCode": "A",
                "roleName": "Author",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/223351\/janet-evanovich",
                "attr": null
              },
              {
                "authorId": 221748,
                "display": "Andy Owens",
                "firstInitial": "A",
                "lastInitial": "O",
                "roleCode": "I",
                "roleName": "Illustrator",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/221748\/andy-owens",
                "attr": null
              },
              {
                "authorId": 221834,
                "display": "Dan Jackson",
                "firstInitial": "D",
                "lastInitial": "J",
                "roleCode": "I",
                "roleName": "Illustrator",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/221834\/dan-jackson",
                "attr": null
              }
            ],
            "formats": [
              {
                "format": "Hardcover",
                "count": 3
              }
            ],
            "seoFriendlyUrl": "\/books\/241575\/troublemaker-book-2-by-evanovich-janet"
          },
          {
            "id": 241685,
            "name": "Troublemaker Book 1",
            "isbn": 9781595824882,
            "subtitle": null,
            "format": "Hardcover",
            "onsale": "2010-07-20",
            "price": 17.99,
            "pages": 112,
            "trim": "6 x 9",
            "isbnDisplay": "978-1-59582-488-2",
            "series": null,
            "imprint": "Dark Horse Books",
            "flapCopy": "Janet Evanovich, the New York Times #1 best-selling author of Finger Lickin' Fifteen, brings Alexandra Barnaby and Sam Hooker, from the hit Barnaby novels Metro Girl and Motor Mouth, to Dark Horse Comics with her debut graphic novel &#8212; Troublemaker!<br><br>Alex Barnaby and Sam Hooker are back together and fighting crime the only way they know how &#8212; by leaving a trail of chaos, panic, and disorder. Alex, an auto mechanic and spotter for racecar driver Sam Hooker, is drawn to trouble like a giant palmetto bug to a day-old taco. Unfortunately, she's also drawn to Hooker in the same fashion. There's no steering clear of trouble or Hooker when friends Rosa and Felicia call for help. A man has gone missing, and in order to find him Barnaby and Hooker will have to go deep into the underbelly of Miami and south Florida, surviving Petro Voodoo, explosions, gift- wrapped body parts, a deadly swamp chase, and Hooker's mom.",
            "authors": [
              {
                "authorId": 223351,
                "display": "Janet Evanovich",
                "firstInitial": "J",
                "lastInitial": "E",
                "roleCode": "A",
                "roleName": "Author",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/223351\/janet-evanovich",
                "attr": null
              },
              {
                "authorId": 226252,
                "display": "Joelle Jones",
                "firstInitial": "J",
                "lastInitial": "J",
                "roleCode": "I",
                "roleName": "Illustrator",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/226252\/joelle-jones",
                "attr": null
              },
              {
                "authorId": 221834,
                "display": "Dan Jackson",
                "firstInitial": "D",
                "lastInitial": "J",
                "roleCode": "I",
                "roleName": "Illustrator",
                "ontour": false,
                "spotlight": null,
                "hasAuthorPhoto": null,
                "photoCredit": null,
                "photoDate": null,
                "seoFriendlyUrl": "\/authors\/221834\/dan-jackson",
                "attr": null
              }
            ],
            "formats": [
              {
                "format": "Hardcover",
                "count": 3
              }
            ],
            "seoFriendlyUrl": "\/books\/241685\/troublemaker-book-1-by-evanovich-janet"
          }
        ],
        "series": [
          
        ],
        "company": {
          "key": "EK",
          "value": "Dark Horse Comics"
        },
        "clientSourceId": 8240,
        "clientAuthors": {
          
        },
        "seoFriendlyUrl": "\/authors\/223351\/janet-evanovich",
        "_embeds": null,
        "_links": [
          
        ]
      }

 

The PRH.com site first renders the content area using the data for the core author and then checks the clientAuthors object to see if there is any additional data. This then is included in a separate area below labeled "Books by Janet Evanovich published by Dark Horse Comics" with covers and titles drawn from that embedded object.

Through a combination of the company and clientSourceId elements, PRH.com is able to stitch together the data from these multiple author records into a single presentation.

Multiple authors and search

The easiest way to find multiple authors is through search.

/domains/PRH.US/search?q=janet+evanovich

      {
        "docType": "author",
        "id": "author-8240-PRH.US",
        "key": "8240",
        "name": "Janet Evanovich",
        "score": 13.140226,
        "url": "\/authors\/8240\/janet-evanovich",
        "domain": [
          "PRH.US"
        ],
        "title": null,
        "description": null,
        "author": null,
        "authorFirst": "Janet",
        "authorLast": "Evanovich",
        "photoCredit": "Roland Scarpa",
        "onTour": true,
        "seriesAuthor": null,
        "seriesIsbn": null,
        "seriesCount": null,
        "_embeds": null,
        "_links": [
          
        ]
      },
      {
        "docType": "author",
        "id": "author-223351-PRH.US",
        "key": "223351",
        "name": "Janet Evanovich",
        "score": 13.140226,
        "url": "\/authors\/223351\/janet-evanovich",
        "domain": [
          "PRH.US"
        ],
        "title": null,
        "description": null,
        "author": null,
        "authorFirst": "Janet",
        "authorLast": "Evanovich",
        "photoCredit": null,
        "onTour": false,
        "seriesAuthor": null,
        "seriesIsbn": null,
        "seriesCount": null,
        "_embeds": null,
        "_links": [
          
        ]
      },

 

If, like PRH.com, you only want to get the core authors back from this, you can use the search parameter companyCode to restrict the results.

/domains/PRH.US/search?q=janet+evanovich&companyCode=R_H

      {
        "docType": "author",
        "id": "author-8240-PRH.US",
        "key": "8240",
        "name": "Janet Evanovich",
        "score": 13.140226,
        "url": "\/authors\/8240\/janet-evanovich",
        "domain": [
          "PRH.US"
        ],
        "title": null,
        "description": null,
        "author": null,
        "authorFirst": "Janet",
        "authorLast": "Evanovich",
        "photoCredit": "Roland Scarpa",
        "onTour": true,
        "seriesAuthor": null,
        "seriesIsbn": null,
        "seriesCount": null,
        "_embeds": null,
        "_links": [
          
        ]
      }

 

Similarly, if you only wanted to get back the "EK", Dark Horse Comics, authors you could specify that. The companyCode parameter can be specified multiple times if needed.

/domains/PRH.US/search?q=janet+evanovich&companyCode=EK

      {
        "docType": "author",
        "id": "author-223351-PRH.US",
        "key": "223351",
        "name": "Janet Evanovich",
        "score": 13.140226,
        "url": "\/authors\/223351\/janet-evanovich",
        "domain": [
          "PRH.US"
        ],
        "title": null,
        "description": null,
        "author": null,
        "authorFirst": "Janet",
        "authorLast": "Evanovich",
        "photoCredit": null,
        "onTour": false,
        "seriesAuthor": null,
        "seriesIsbn": null,
        "seriesCount": null,
        "_embeds": null,
        "_links": [
          
        ]
      }

 

The same companyCode parameter can be used with the predictive endpont.

/domains/PRH.US/search/predictive?q=janet+evanovich&companyCode=R_H&docType=author

{
  "docType": "author",
  "id": "author-8240-PRH.US",
  "key": "8240",
  "name": "Janet Evanovich",
  "score": 3.7238808,
  "url": "\/authors\/8240\/janet-evanovich",
  "domain": null,
  "title": null,
  "description": null,
  "author": null,
  "authorFirst": null,
  "authorLast": null,
  "photoCredit": null,
  "onTour": null,
  "seriesAuthor": null,
  "seriesIsbn": null,
  "seriesCount": null,
  "_embeds": null,
  "_links": [
    
  ]
}