WhiteHouse / petitions

Drupal installation profile powering We The People at petitions.whitehouse.gov
https://petitions.whitehouse.gov/
1.14k stars 336 forks source link

What happens when I pass an invalid API key with my request? #85

Open theneonlobster opened 11 years ago

theneonlobster commented 11 years ago

I am building a web application that will submit signatures via the write API and confirm that signatures have been validated via the validations resource. If I pass an invalid API key with my request, will I get a response?

rwildema commented 10 years ago

Hi, This reply is a bit late, but the JSON response from the validate API call actually sent me here! I've found that you will get a 401 response. The JSON returned looks like this: { "metadata": { "responseInfo": { "status": 400, "developerMessage": "401 Unauthorized: Invalid key.", "userMessage": "The key provided is not valid.", "errorCode": "85", "moreInfo": "See issue #85 on github: https://github.com/whitehouse/petitions/issues/85" } } }

You can test API calls easily with the Postman Chrome extension. Hope that helps!