Skip to content
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

downLoad links do not resolve with uppercase API_KEY #13

Closed
fgregg opened this issue Sep 27, 2018 · 3 comments
Closed

downLoad links do not resolve with uppercase API_KEY #13

fgregg opened this issue Sep 27, 2018 · 3 comments
Assignees
Labels
Upcoming Items currently under development and will be available in our next release
Milestone

Comments

@fgregg
Copy link

fgregg commented Sep 27, 2018

This url https://api.govinfo.gov/packages/CHRG-114jhrg94577/summary?API_KEY=DEMO_KEY returns the following response:

{'branch': 'legislative',
 'category': 'Congressional Committee Materials',
 'chamber': 'JOINT',
 'collectionCode': 'CHRG',
 'collectionName': 'Congressional Hearings',
 'congress': '114',
 'dateIssued': '2018-07-17',
 'detailsLink': 'https://www.govinfo.gov/app/details/CHRG-114jhrg94577',
 'documentType': 'JHRG',
 'download': {'modsLink': 'https://api.govinfo.gov/packages/CHRG-114jhrg94577/mods',
              'premisLink': 'https://api.govinfo.gov/packages/CHRG-114jhrg94577/premis',
              'zipLink': 'https://api.govinfo.gov/packages/CHRG-114jhrg94577/zip'},
 'governmentAuthor1': 'Congress',
 'granulesLink': 'https://api.govinfo.gov/packages/CHRG-114jhrg94577/granules?offset=0&pageSize=100',
 'heldDates': ['2018-07-17'],
 'lastModified': '2018-07-30T19:54:06Z',
 'otherIdentifier': {'migrated-doc-id': 'f:94577.txt'},
 'packageId': 'CHRG-114jhrg94577',
 'pages': '156',
 'publisher': 'U.S. Government Publishing Office',
 'session': '2',
 'title': 'Addendum'}

The download links do not resolve. https://api.govinfo.gov/packages/CHRG-114jhrg94577/zip?API_KEY=DEMO_KEY returns

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /govinfoapi//packages/CHRG-114jhrg94577/zip was not found on this server.</p>
</body></html>

and similar for the modsLink and the premisLink

@jonquandt
Copy link
Member

jonquandt commented Sep 27, 2018

@fgregg -

can you try it with:
https://api.govinfo.gov/packages/CHRG-114jhrg94577/zip?api_key=DEMO_KEY
https://api.govinfo.gov/packages/CHRG-114jhrg94577/premis?api_key=DEMO_KEY
https://api.govinfo.gov/packages/CHRG-114jhrg94577/mods?api_key=DEMO_KEY

I am able to get those files to return when I use api_key instead of API_KEY

I'm not sure why the casing on API_KEY vs api_key would make a difference for those resources and not for the /summary, but I will check with the api.data.gov folks to see if they know of anything similar happening.

Also, did you know you can send your key via a header instead of the url?

https://api.data.gov/docs/api-key/

@jonquandt jonquandt self-assigned this Sep 27, 2018
@fgregg
Copy link
Author

fgregg commented Sep 27, 2018

Thanks, it does look like casing is the issue.

@jonquandt jonquandt added the Upcoming Items currently under development and will be available in our next release label Oct 3, 2018
@jonquandt jonquandt changed the title downLoad links listed in package summary do not resolve downLoad links do not resolve with uppercase API_KEY Nov 1, 2018
@jonquandt jonquandt added this to the December 2018 milestone Nov 15, 2018
@jonquandt
Copy link
Member

This is now fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Upcoming Items currently under development and will be available in our next release
Projects
None yet
Development

No branches or pull requests

2 participants