Hi,
I’m using (I believe) everything correctly with the latest Ruby SDK, but I’m getting the notorious “missing required parameter ‘client_id’” error when trying to obtain the token.
App ID: sandbox-sq0idb-yxibw1qw1_oQQg8RxBw6Mw
Code:
client = Square::Client.new(
base_url: "https://connect.squareupsandbox.com" # Square::Environment::SANDBOX
) # I tried specifying the URL directly
# Provide the code in a request to the Obtain Token endpoint
oauth_request_body = {
'client_id ' => application_id,
'client_secret' => application_secret,
'code' => authorization_code,
'grant_type' => 'authorization_code'
}
response = oauth_api.obtain_token(**oauth_request_body)
Log line:
2025-09-06 10:10:13 - RuntimeError - {
"message": "missing required parameter 'client_id'",
"type": "bad_request.missing_parameter"
}
:
/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/square.rb-44.0.0.20250820/lib/square/o_auth/client.rb:77:in `obtain_token'
If I take the code and use the API Explorer, I can obtain the token no problem, so I assume something is wrong in my configuration, but no idea what ![]()
Thanks in advance!