Retrieving Record Citations
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 Name | Description | Required/Optional | Parameter Type | Format | Default | Example Values |
---|---|---|---|---|---|---|
x-authenticationToken | Token identifying the caller. | Required | Header | string | - | f4714669-ebfa-40d3-acac-bf6e0f22fbb9 |
x-sessionToken | Token identifying the session this call is in relation to. | Required | Header | string | - | 4cc009f9-6acd-4a82-ab9f-0401392431a4.kL9OvDK8pTL7x5YDaaCyzg== |
DBID | Database short name specifying which database to retrieve the record from | Required | Query | string | "lfh" | |
AN | Identifier of the record to obtain | Required | Query | string | a9h | |
styles | Comma separated list of citation styles to build. To request all available citations, use the value 'all'. | Required | Query | String | mla,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
Field | Description | Required |
---|---|---|
Id | The ID for the citation style. | Yes |
Label | The name of the citation style/standard represented by the citation. This is the displayed citation style label. | Yes |
Indent | Some 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 |
SectionLabel | Standard specific section heading label. | Yes |
Caption | An optional description of what the cite style is. | No |
Data | The data of the citation that is formatted per the citation style. | Yes |
Error | Message 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
Placeholder | Description |
---|---|
<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
Error | Description |
---|---|
150 | Error occurred when calling Citation Adapter Service |
151 | Citation Styles are not available for this record |
Updated 17 days ago