When authenticating against APIs many will require the use of an OAuth ‘callback’ which will (usually) return the bearer token which is needed to make subsequent requests as the user who is logging in.
For a nice simple explanation of the process check out the blog post Introduction to OAuth (in Plain English)
Exactly how that works varies from system-to-system and will require you to read the documentation for the API that you’re trying to login to.
We’ve provided resources which will help make that process a lot smoother for you:
- the Basics of an OAuth Script provides the generic steps to take, including examples
- most importantly the OAuth Demonstration File contains a complete working example for logging in to Google APIs.
Over time we will extend that demo file to cover other services as well. Let us know which APIs you’d like us to create sample scripts for next!