I’m stuck trying to sync customer data between a CRM service and my SQL database. The goal is to keep user information updated in both systems automatically. I can pull data using OAuth playground tools, but I can’t get the API connection working in R.
What I’ve attempted:
Method 1: Third-party service
Found some integration platforms but they cost money and I’m not sure about reliability.
Method 2: Custom R solution
Tried using ROAuth and httr packages but authentication keeps failing.
# First attempt with OAuth
api_endpoint <- 'https://api.crmservice.com/contacts/v1/all'
auth_url <- 'https://app.crmservice.com/oauth/authorize?client_id=[app_id]&scope=contacts&redirect_uri=https://mysite.com'
app_id <- 'my_application_id'
app_secret <- 'my_application_secret'
auth_setup <- OAuthFactory(consumerKey=app_id,
consumerSecret=app_secret,
requestURL=api_endpoint,
accessURL=token_url,
authURL=auth_url)
# Second attempt with direct API call
curl('https://api.crmservice.com/contacts/v1/all/apikey=[my_key]/get')
I have all the required credentials including client ID, secret, and API key. The authentication endpoints are set up correctly. Has anyone successfully connected to similar CRM APIs from R? What am I missing in the authentication flow?