I am trying to use Signet::Oauth2::Client to get an access token from getresponse.com
client = Signet::OAuth2::Client.new(
client_id: GET_RESPONSE_CLIENT_ID,
client_secret: GET_RESPONSE_CLIENT_SECRET,
token_credential_uri: 'https://api.getresponse.com/v3/token',
redirect_uri: my_callback_uri,
grant_type: 'authorization_code',
code: the_code_i_got_from_get_response
)
response = client.fetch_access_token!
However Get Response always returns this:
{"error"=>"invalid_client", "error_description"=>"Client credentials were not found in the headers"}
I have done this request with curl easily. It returns successfully with the tokens.
curl -v -u client_id:client_secret https://api.getresponse.com/v3/token -d "grant_type=authorization_code&code=abc123thisisthecode&redirect_uri=https://myserver.com/callback"
I have tried a million things and read the client source but I didn't see want I am doing wrong. I will continue to read the docs but in the meantime I thought I would ask the pros here at stackoverflow. Does anyone know the answer? Here is the api docs https://apidocs.getresponse.com/v3/oauth2
Ran into similar issues. I following steps below and worked for me.
Step.1 Load your credentials obtained from google developers console.
Step 2. Load up your Signet client to fetch the access token necessary for accessing required APIs.