Created
October 1, 2018 11:46
-
-
Save amolpujari/ad9654b8299d10f09d61c2bcc7dd90b8 to your computer and use it in GitHub Desktop.
skype interviews api ruby example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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