×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Generating an OAuth Token - Steps using R

Generating an OAuth Token - Steps using R

Generating an OAuth Token - Steps using R

(OP)
Appreciate some timely insight!

Novice - first time attempting to extract data via an API.

I obtained a API Key and the Secret.

Converted to base64.

Now perplexed as to the next step where the instructions that I have state that I should "Enter the generated base64value in the header and request body and call the token URI as shown below;

CODE

Authorization: Basic {base64value} 
Content-Type: application/x-www-form-urlencoded 
POST https://api.destination.com/oauth/token
grant_type=client_credentials 

Any insight as to if R can be used to obtain the OAuth Token?

If so, what are the required packages that I need to install?


Thanks in advance.

RE: Generating an OAuth Token - Steps using R

(OP)
Any insight as to the resolution of a status code of 401 using the R code below?

Attempting to generate an oauth token.

Thanks in advance.

CODE

library(httr)

base64_value <-
  "123456789="
  

response16 <-
  httr::POST (url = "https://api.precisely.com/oauth/token" , 
             httr::add_headers(Authorization = paste("Basic", base64_value, sep = "")),
             body = list(grant_type = "client_credentials"),
             encode = "form"
             )

#verbose(data_out = true, data_in = False, info = false, ssl = false)


warn_for_status(response16)
stop_for_status(response16) 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close