Skip to content

Instantly share code, notes, and snippets.

@amolpujari
Created October 1, 2018 11:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amolpujari/ad9654b8299d10f09d61c2bcc7dd90b8 to your computer and use it in GitHub Desktop.
Save amolpujari/ad9654b8299d10f09d61c2bcc7dd90b8 to your computer and use it in GitHub Desktop.
skype interviews api ruby example
require 'jwt'
require 'json'
API_KEY = "key"
API_SECRET = "secret"
token = JWT.encode({
jti: SecureRandom.hex,
iss: API_KEY,
iat: Time.now.to_i,
sub: Digest::SHA256.hexdigest("{}"),
exp: Time.now.to_i+10
}, API_SECRET)
headers = {
'Content-Type': 'application/json',
'Authorization': "Bearer #{token}"
}
res = RestClient.post "https://interviews.skype.com/api/interviews", "{}", headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment