I believe this depends on your organization's administrative settings. If they enable API keys per user, you should be able to use that. In my case, I was actually able to use the username:password and I didn't even need an API key. Oauth, or Oauth2 is quite a bit more complicated to implement, not sure that would stack well on my mostly BASH scripts I setup here.