Retrieving Record Citations

This is a description

The /edsapi/rest/citationstyles endpoint retrieves a record citation(s) by specifying an AN, database, and a list of formats. You will find the AN and DBID of a record in the header of the /edsapi/rest/search or /edsapi/rest/retrieve response message. The /edsapi/rest/search response message header below.

<Record>
    <ResultId>1</ResultId>
        <Header>
            <DbId>a9h</DbId>
            <DbLabel>Academic Search Complete</DbLabel>
            <An>129860888</An>
            <RelevancyScore>2340</RelevancyScore>
        </Header>
        .
        .
        .
</Record>

Endpoint URL for Retrieving Citations

GET /eds-api.ebscohost.com/edsapi/rest/citationstyles

Data Parameters

Parameter NameDescriptionRequired/OptionalParameter TypeFormatDefaultExample Values
x-authenticationTokenToken identifying the caller.RequiredHeaderstring-f4714669-ebfa-40d3-acac-bf6e0f22fbb9
x-sessionTokenToken identifying the session this call is in relation to.RequiredHeaderstring-4cc009f9-6acd-4a82-ab9f-0401392431a4.kL9OvDK8pTL7x5YDaaCyzg==
DBIDDatabase short name specifying which database to retrieve the record fromRequiredQuerystring"lfh"
ANIdentifier of the record to obtainRequiredQuerystringa9h
stylesComma separated list of citation styles to build. To request all available citations, use the value 'all'.RequiredQueryStringmla,chicago

/edsapi/rest/citationstyles supports application/xml or application/json.

Request

GET http://eds-api.ebscohost.com/edsapi/rest/CitationStyles?an=129860888&dbid=aph&styles=mla%2cchicago

Response

{
    "Citations":[
        {
            "Id":"mla",
            "Label":"MLA",
            "SectionLabel":"Works Cited",
            "Data":"Sanderson, Katharine. “H2Oh!: Water Is Not One Liquid... It’s Two, Says Katharine Sanderson.” <i>New Scientist<\/i>, vol. 238, no. 3180, June 2018, pp. 26–29.","Caption":"Modern Language Assoc.",
            "Indent":1
        },
        {
            "Id":"chicago",
            "Label":"Chicago\/Turabian: Author-Date",
            "SectionLabel":"Reference List",
            "Data":"Sanderson, Katharine. 2018. “H2Oh!: Water Is Not One Liquid... It’s Two, Says Katharine Sanderson.” <i>New Scientist<\/i> 238 (3180): 26–29.",
            "Indent":1
        }
    ]
}
<CitationStylesResponseMessage xmlns="http://epnet.com/webservices/EbscoApi/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Citations>
    <Citation>
      <Id>mla</Id>
      <Label>MLA</Label>
      <SectionLabel>Works Cited</SectionLabel>
      <Data>Sanderson, Katharine. “H2Oh!: Water Is Not One Liquid... It’s Two, Says Katharine Sanderson.” <i>New Scientist</i>, vol. 238, no. 3180, June 2018, pp. 26–29.</Data>
      <Caption>Modern Language Assoc.</Caption>
      <Indent>1</Indent>
    </Citation>
    <Citation>
      <Id>chicago</Id>
      <Label>Chicago/Turabian: Author-Date</Label>
      <SectionLabel>Reference List</SectionLabel>
      <Data>Sanderson, Katharine. 2018. “H2Oh!: Water Is Not One Liquid... It’s Two, Says Katharine Sanderson.” <i>New Scientist</i> 238 (3180): 26–29.</Data>
      <Indent>1</Indent>
    </Citation>
  </Citations>
</CitationStylesResponseMessage>

The response can be XML or JSON. The response format is defined by the Accept value set in the HTTP header. If the Accept value is not present in the HTTP header, the Content-type value in the HTTP header is used. The AuthTimeout value in the response is in seconds.

Response Elements

FieldDescriptionRequired
IdThe ID for the citation style.Yes
LabelThe name of the citation style/standard represented by the citation. This is the displayed citation style label.Yes
IndentSome citation standards use a "hanging indent". This causes the body to be indented by 1/2 inch from the second line onward. The value is "1" if the citation should use a hanging indent. If not present or is a different value, there should not be an indent.No
SectionLabelStandard specific section heading label.Yes
CaptionAn optional description of what the cite style is.No
DataThe data of the citation that is formatted per the citation style.Yes
ErrorMessage returned if there was an error returning the requested style. (ex. Style does not exist.)No

The values below are placeholders that represent changes in style or other substitution.

Template Placeholders

PlaceholderDescription
<i>/</i>Start / end of an italicized piece of text.
<b>/</b>Start / end of a bolded piece of text.

Sample JSON Reponse with Mapping to a Sample UI

Error Handling

Sample error responses for when the database does not support citations and invalid citations are below.

Database Does Not Support Citations

{
    "DetailedErrorDescription":"",
    "ErrorDescription":“Citation Styles are not available for this record.”,
    "ErrorNumber":"151"
}
<APIErrorMessage xmlns="http://epnet.com/webservices/EbscoApi" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <DetailedErrorDescription />
  <ErrorDescription>Citation Styles are not available for this record.</ErrorDescription>
  <ErrorNumber>151</ErrorNumber>
</APIErrorMessage>

Invalid Citation

{
    "Citations":[
        {
            "Id":"someInvalidStyle",
            "Label":null,
            "SectionLabel":null,
            "Data":null,
            "Error":"Invalid citation style"
         }
    ]
}

Possible Citation Style Errors Returned

ErrorDescription
150Error occurred when calling Citation Adapter Service
151Citation Styles are not available for this record