-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Granule Content Type Error #22
Comments
@cnizzardini - the first request is failing because CREC packages (and granules) do not have an XML representation of the content. The API is handling your request for an XML of the content and the server is returning our standard 404 for content that doesn't exist. You may want to add the -L switch to your curl request so that your request follows internal server redirects: $ curl -L -X GET "https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/xml?api_key=DEMO_KEY" -H "accept: /"
Your options for content download for the granule you're looking for is available via the summary endpoint. e.g.: curl -X GET "https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/summary?api_key=DEMO_KEY" -H "accept: /" {"title":"Daily Digest/House of Representatives","collectionCode":"CREC","collectionName":"Congressional Record","category":"Proceedings of Congress and General Congressional Publications","dateIssued":"2018-01-04","detailsLink":"https://www.govinfo.gov/app/details/CREC-2018-01-04/CREC-2018-01-04-pt1-PgD7-3","granulesLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/granules?offset=0&pageSize=100","packageId":"CREC-2018-01-04","packageLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/summary","granuleId":"CREC-2018-01-04-pt1-PgD7-3","download":{"txtLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/htm","pdfLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/pdf","modsLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/mods","premisLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/premis","zipLink":"https://api.govinfo.gov/packages/CREC-2018-01-04/zip"},"bookNumber":"1","granuleClass":"DAILYDIGEST","subGranuleClass":"DDHCHAMBER","granuleDate":"2018-01-04","pagePrefix":"D","lastModified":"2018-07-31T12:43:00Z"} The download section in the summary shows:
MODS and PREMIS present descriptive and preservation metadata about the content in xml format. You'll see that performing a request for the htm rendition does return content as expected in curl: $ curl -X GET "https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/htm?api_key=DEMO_KEY" -H "accept: /"
The API documentation page isn't really intended for curling in that manner -- since that /docs is a page that then fires off several requests to serve the swagger.json file in a (human) user-friendly manner You could also just request the swagger.json directly via https://api.govinfo.gov/swagger.json I hope that helps. |
Running:
curl -X GET "https://api.govinfo.gov/packages/CREC-2018-01-04/granules/CREC-2018-01-04-pt1-PgD7-3/xml?api_key=DEMO_KEY" -H "accept: */*"
Response:
The API explorer doesn't handle it well either https://api.govinfo.gov/docs/
The text was updated successfully, but these errors were encountered: