Secret Key Authentication

Examples

Weather Underground – requires you to create an API key and then send it in your base URL. Because of this, you have to use the {secretkeyautotools} placeholder like this: http://api.wunderground.com/api/{secretkeyautotools}/

Google Maps Directions – Requires you to create an API key and then send it as the “key” query parameter like this: https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&key=YOUR_API_KEY. Here you’ll have to set the “Secret Key Parameter” field in AutoWeb to “key” to tell AutoWeb to send it as that parameter.

Xbox Unofficial – Here you’ll send the API key in the request headers.  You’ll add a header like this to every request: “X-AUTH: YOUR_AUTH_KEY_HERE“. To do this in AutoWeb simply fill in the “Secret Key Parameter” field. It’ll send the parameter in the headers as well as a query parameter.

 

Secret Key Specific Fields:

Secret Key – the key you generated at the Web service’s website.

Secret Key Parameter – url query parameter name or header name where the secret key will be sent with every request. If set to “supersecretkey” for example This will add something like this to every request url: http://example.com/?supersecretkey=API_KEY and will add this header to every request: “supersecretkey: API_KEY

Sign-up Website  – optional but recommended. Will be used when a user imports the API in AutoWeb but doesn’t have a Secret Key yet. If this is set, the website will open and the user imports the API and the authentication instructions will be shown at the top. When the user signs up, AutoWeb will search the page’s source code for the API as defined in the Website Regex field. If it finds the API key, it will automatically copy it and use it in the Secret Key field.

Website Regex  – Define a regex to find the API key. When the user is signing up in the Sign-up Website this regex will try to match the page’s source code to find the api key automatically. The regex match should contain the api key in its first match group. For example, if a website’s source code contains the API key in a place like this

<div id="API_KEY">Your API key is 010927309127</div>

you can use the regex
<div id="API_KEY">Your API key is (.+?)</div>
to get the API key in the first match group shown in bold.

To learn more about regexes go here.