Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to use user_params in token_fetch() function #273

@selesnow

Description

@selesnow

Hello, previosly i use next code:

library(gargle)
library(httr)

# OAuth клиент
app <- oauth_app(
  appname = 'myapp',
  key = 'xxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com',
  secret = 'xxxxxxxxxxxxxxxxxxxxxxxx'
)

# Авторизация
cred <- token_fetch(
  scopes  = 'https://www.googleapis.com/auth/adwords',
  app     = app,
  email   = '[email protected]',
  cache   = TRUE,
  user_params = list(developer_token = "xxxxxxxxxxx")
)

# Создаём запрос
req <- request_build(
  method   = "GET",
  path     = 'v9/customers:listAccessibleCustomers',
  token    = cred,
  base_url = "https://googleads.googleapis.com/"
)

# Отправляем запрос
resp <- request_retry(
  req,
  add_headers(
    `developer-token`= cred$params$user_params$developer_token
  )
)

# Парсим ответ
result <- response_process(resp)

And it worked correctly, but now cred$params$user_params$developer_token is empty, can you help me?

How i need to use user_params argument?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions