Discussions

Ask a Question
Back to All

Unexpected error has occurred. We apologize for the inconvenience.

I'm trying to connect to your API using Ruby's OAuth2 gem (https://github.com/oauth-xx/oauth2). I've created an account in the sandbox here, and followed the process as well as I can understand from the documentation. It appears that I'm receiving a token, but when I make a request with it, I get back the subject line. More accurately:

{"code":100,"message":"Unexpected error has occurred. We apologize for the inconvenience."}

Here's the series of commands I'm sending:

client = OAuth2::Client.new('<client_id>', '<client_secret>', site: 'https://sandbox-api.veem.com')

client.auth_code.authorize_url(redirect_uri: 'http://localhost:3000/oauth2/callback')

token = client.client_credentials.get_token(redirect_uri: 'http://localhost:3000/oauth2/callback', headers: {'Authorization' => 'Basic '})

response = token.post('/veem/v1.1/payments', params: {'notes' => 'Delivery bill', 'payee' => {'type': 'Business', 'firstName': 'Joe', 'lastName': 'Doe', 'businessName': 'BAC Inc.', 'countryCode': 'US', 'email': '[email protected]', 'phone': '19052333333'}, 'payeeAmount': {'currency': 'USD', 'number': '1000'}, 'purposeOfPayment': 'Goods'}, headers: {'X-Request-Id': '3b6a6436-561d-4643-9f83-ce837999213a'})

Any assistance you can provide would be much appreciated!

Thanks,
Aaron