Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to send POST request in R but didn't work #4

Open
garyzhubc opened this issue Mar 25, 2022 · 2 comments
Open

Trying to send POST request in R but didn't work #4

garyzhubc opened this issue Mar 25, 2022 · 2 comments

Comments

@garyzhubc
Copy link

garyzhubc commented Mar 25, 2022

Trying to send POST request in R but didn't work. I tried:

require(httr)

token_endpoint = 'https://icdaccessmanagement.who.int/connect/token'
client_id = '-------'
client_secret = '----'
scope = 'icdapi_access'
grant_type = 'client_credentials'

r <- POST(token_endpoint, add_headers('client_id'= client_id, 
                                            'client_secret'= client_secret, 
                                            'scope'= scope, 
                                            'grant_type'= grant_type))

with package httr following a Python version of this https://github.com/ICD-API/Python-samples/blob/master/sample.py

but I don't know where to find access_token in r

enter image description here

@garyzhubc garyzhubc changed the title Trying to do this in R but didn't work Trying to send POST request in R but didn't work Mar 25, 2022
@MITEL-UNIUD
Copy link
Collaborator

MITEL-UNIUD commented Mar 28, 2022

Please, do not put real id and secret in examples. I edited your post.

@JosephSBoyle
Copy link

FWIW I can still view the secrets in the history of the post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants