Trying to make an OAuth1.0 API call and the script works fine when I export from POstman but only once.

It seems like the token expires after the first API call. The question is how do i generate an Oauth signature using HMAC-SHA256 in R, if i have client id, secret, consumer key and consumer secret

library(httr)

headers = c(
  'Content-Type' = 'Application/JSON',
  'Authorization' = 'OAuth realm="586038",oauth_consumer_key="200b3bac************",oauth_token="58a0591cde917e****************",oauth_signature_method="HMAC-SHA256",oauth_timestamp="1708108304",oauth_nonce="r4nRTdCFF7h",oauth_version="1.0",oauth_signature="*********************%2FSZTdJVfNB%2Fm9o%3D"'
)

body = "{\r\n    \"query\":\"Select LastName from CONTACT where FirstName='Livio'\"\r\n}"

res <- VERB("POST", url = "https://******.restlets.api.netsuite.com/app/site/**********", body = body, add_headers(headers))

cat(content(res, 'text'))

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.