How is it possible to get token for the Sabre API in R similar to this post here for python: How do I perform oauth2 for Sabre Dev Network using python?
As far as I understand I need to use OAuth2 verification process. For R I found the httr
package with this function oauth2.0_token
here but I'm not able to put in the right parameters in order to get a token.
My code so far:
library(base64enc)
library(base64)
clientID <- "V1:userid:group:domain" #Example clientID
clientIDRaw <- charToRaw(clientID)
clientIDEnc <- base64encode(clientIDRaw)
password <- "12345" #Example password
passwordRaw <- charToRaw(password)
passwordEnc<- base64encode(passwordRaw)
combined <- paste(clientIDEnc, ":", passwordEnc, sep="")
combinedRaw <- charToRaw(combined)
combinedEnc <- base64encode(combinedRaw)
With the combinedEnc
variable I should be able to retrieve my token?