I’m trying to create a connection to Galaxy Digital’s getconnected platform. I’m told they also use a ‘Bearer Token’ API key, which I have.
I started with an API Key authentication with the following required fields, and even added the Header option suggested in another answer - did I get that right?
When I ran this and entered my 3 fields for authentication, I get the 401 error at bottom.
Did I simply login invalid? Or is something wrong with my authentication?
Thanks!
John
We hit an error adding your new account authentication failed: The app returned "Unauthenticated.". What happened (You are seeing this because you are an admin): Stack trace: ResponseError: {"status":401,"headers":{"content-type":"application/json","retry-after":null},"content":"{\"message\":\"Unauthenticated.\"}","request":{"url":"https://ca.volunteerapi.com/api/users?Authorization=Bearer%20%5BTOKEN%5D&password= ****************** &api_key=f28ef87c-**********************&email=john%40johnkirkwood.ca"}} at _throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:13:11) at Object.outResp.throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:68:5) at throwForStatusMiddleware (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-status.js:5:14) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:80:37) From previous event: at /var/task/node_modules/zapier-platform-core/src/middleware.js:77:26 at Array.reduce (<anonymous>) at afterMiddleware (/var/task/node_modules/zapier-platform-core/src/middleware.js:76:21) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:94:18) From previous event: at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:92:10) From previous event: at /var/task/node_modules/zapier-platform-core/src/middleware.js:89:45 at /var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:212:18 at bound (node:domain:433:15) at runBound (node:domain:444:12) at processImmediate (node:internal/timers:466:21) at process.topLevelDomainCallback (node:domain:161:15) at process.callbackTrampoline (node:internal/async_hooks:128:24) From previous event: at Domain.<anonymous> (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:196:10) at Domain.run (node:domain:389:15) at Runtime.handler (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:192:19) at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1086:29)
Make sure you click "Allow" or "Accept" on the permission popup Double check your Account has the correct permissions Check out our help docs for more information
Page 1 / 1
Just got a reply from Galaxy, but it’s Greek to me:
“From your screenshot hof Zapier authentication options] and my knowledge of our API, I would recommend looking at Session Auth, because our API login endpoint generates a token after you enter your credentials in the /login endpoint.
Here are some resources that will help you get started:
A sample CURL request so you can have a template of what a login request looks like with our API
When you call this endpoint, it will give you a token that you can use to authenticate calls to all other API endpoints. Based on the description in Zapier, Session Auth sounds like the right choice!”
Please help!
Thx :)
Hi @jkirkwood001 ,
Thanks for sharing those super helpful details!
Taking a look, one that stands out to me is that the endpoint/url in your screenshot is a bit different than the one shared by Galaxy Digital in their example code.
Galaxy Digital’s code seems to refer to these docs:
Click Show Options to make sure the Authentication Fields are included in the request body
Hope this points you in the right direction!
Thanks @connorz !
Still getting authentication errors. I think I’m by the authentication, but the GET failed.
Here’s what I entered:
(I treied both login strings)
And here’s the error (odd, because I also tried GET for both places besides a PUT for the token request)
We hit an error adding your new account
authentication failed: The app returned "405". What happened (You are seeing this because you are an admin): Stack trace: ResponseError: {"status":405,"headers":{"content-type":"text/html; charset=iso-8859-1","retry-after":null},"content":"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>405 Method Not Allowed</title>\n</head><body>\n<h1>Method Not Allowed</h1>\n<p>The requested method PUT is not allowed for this URL.</p>\n</body></html>\n","request":{"url":"http://api.galaxydigital.com/docs/#/Login/login?Authorization=Bearer%20%5BTOKEN%5D"}} at _throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:13:11) at Object.outResp.throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:68:5) at throwForStatusMiddleware (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-status.js:5:14) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:80:37) From previous event: at /var/task/node_modules/zapier-platform-core/src/middleware.js:77:26 at Array.reduce (<anonymous>) at afterMiddleware (/var/task/node_modules/zapier-platform-core/src/middleware.js:76:21) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:94:18) From previous event: at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:92:10) From previous event: at /var/task/node_modules/zapier-platform-core/src/middleware.js:89:45 at /var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:212:18 at bound (node:domain:433:15) at runBound (node:domain:444:12) at processImmediate (node:internal/timers:466:21) at process.topLevelDomainCallback (node:domain:161:15) at process.callbackTrampoline (node:internal/async_hooks:128:24) From previous event: at Domain.<anonymous> (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:196:10) at Domain.run (node:domain:389:15) at Runtime.handler (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:192:19) at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1086:29)
Click the HTTP Headers tab and add the combo: Authorization / Bearer {{bundle.authData.token}}
Then let’s try testing the auth again.
If that does not help, please feel free to reach out to our team and we’ll be glad to take a closer look at the integration: https://developer.zapier.com/contact
@connorz thanks so much for really trying to help.
Okay I did everything you listed exactly and still got an error.
Not sure if I entered this right? There was an error when I typed exactly what you had which was “Authorization / Bearer” so I separated them:
authentication failed: Authorization / Bearer is not a legal HTTP header name What happened (You are seeing this because you are an admin): Starting GET request to https://api.galaxydigital.com/api/users Authorization / Bearer is not a legal HTTP header name Console logs: Stack trace: TypeError: Authorization / Bearer is not a legal HTTP header name at validateName (/var/task/node_modules/node-fetch/lib/index.js:677:9) at Headers.append (/var/task/node_modules/node-fetch/lib/index.js:835:3) at new Headers (/var/task/node_modules/node-fetch/lib/index.js:761:11) at new Request (/var/task/node_modules/node-fetch/lib/index.js:1231:19) at new PatchedRequest (/var/task/node_modules/zapier-platform-core/src/tools/fetch.js:22:5) at newFetch (/var/task/node_modules/zapier-platform-core/src/tools/fetch.js:54:19) at request (/var/task/node_modules/zapier-platform-core/src/tools/request-client.js:26:10) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:90:22) at bound (node:domain:433:15) at Object.runBound (node:domain:444:12) at Object.tryCatcher (/var/task/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/var/task/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/var/task/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/var/task/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/var/task/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/var/task/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/var/task/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues uas _onImmediate] (/var/task/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (node:internal/timers:466:21) at process.topLevelDomainCallback (node:domain:161:15) at process.callbackTrampoline (node:internal/async_hooks:128:24)
Not sure how to ‘share’ this without publishing, but here’s the URL:
...and it keeps saying “This account is expired.” so I’m re-entering my credentials each time. Why does it think I’m ‘Anonymous’?
authentication failed: What happened (You are seeing this because you are an admin): Starting GET request to https://api.galaxydigital.com/api/users Received 401 code from https://api.galaxydigital.com/api/users after 56ms Received content "{"message":"Unauthenticated."}" Console logs: Stack trace: RefreshAuthError at throwForStaleAuth (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-stale-auth.js:10:11) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:80:37) at bound (node:domain:433:15) at Object.runBound (node:domain:444:12) at Object.tryCatcher (/var/task/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/var/task/node_modules/bluebird/js/release/promise.js:547:31) at Promise._settlePromise (/var/task/node_modules/bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/var/task/node_modules/bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/var/task/node_modules/bluebird/js/release/promise.js:729:18) at _drainQueueStep (/var/task/node_modules/bluebird/js/release/async.js:93:12) at _drainQueue (/var/task/node_modules/bluebird/js/release/async.js:86:9) at Async._drainQueues (/var/task/node_modules/bluebird/js/release/async.js:102:5) at Immediate.Async.drainQueues cas _onImmediate] (/var/task/node_modules/bluebird/js/release/async.js:15:14) at processImmediate (node:internal/timers:466:21) at process.topLevelDomainCallback (node:domain:161:15) at process.callbackTrampoline (node:internal/async_hooks:128:24)
Hey @jkirkwood001 ,
Thanks for giving that a try! I think we’re getting close.
In the test request’s headers, can you please try passing the following?
One header where the key is “Authorization” and the value is “Bearer {{bundle.authData.token}}”
To be transparent, I’m not entirely clear on how exactly they expect this header to be formatted, but the above is a pretty standard convention.
Changed these Labels to be in sync:
Now I get this different (progressing?) error - it’s still suggests I’m logging in as ‘Anonymous’ :
authentication failed: The app returned "The given data was invalid.". What happened (You are seeing this because you are an admin): Stack trace: ResponseError: {"status":422,"headers":{"content-type":"application/json","retry-after":null},"content":"{\"message\":\"The given data was invalid.\",\"errors\":{\"key\":r\"The key field is required.\"]}}","request":{"url":"https://api.galaxydigital.com/api/users/login"}} at _throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:13:11) at Object.outResp.throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/prepare-response.js:68:5) at throwForStatusMiddleware (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-status.js:5:14) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:80:37) From previous event: at /var/task/node_modules/zapier-platform-core/src/middleware.js:77:26 at Array.reduce (<anonymous>) at afterMiddleware (/var/task/node_modules/zapier-platform-core/src/middleware.js:76:21) at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:94:18) From previous event: at Object.<anonymous> (/var/task/node_modules/zapier-platform-core/src/middleware.js:92:10) From previous event: at /var/task/node_modules/zapier-platform-core/src/middleware.js:89:45 at /var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:212:18 at bound (node:domain:433:15) at runBound (node:domain:444:12) at processImmediate (node:internal/timers:466:21) at process.topLevelDomainCallback (node:domain:161:15) at process.callbackTrampoline (node:internal/async_hooks:128:24) From previous event: at Domain.<anonymous> (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:196:10) at Domain.run (node:domain:389:15) at Runtime.handler (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:192:19) at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1086:29)
… I’ve also got a dozen ‘Connections’ in my Zapier profile, presumably all failed version of the one I’m editing..? Should I delete them all before trying again? Guess it couldn’t hurt...
Hi @jkirkwood001 ,
Yes, feel free to delete those failed connections.
Regarding the error, it appears that Galaxy Digital’s API expects the API key property to be named key.
Can you please try renaming that property in the token exchange request to key (instead of api_key)?
Hi @connorz ,
Thanks again. Tried that and it also didn’t work:
Produced:
I should have included earlier, but here is the last email they sent me (I don’t know what a ‘CURL request’ is) - does this help?
Hi @jkirkwood001 ,
I see that the key of the API key field was changed, so it looks like the API key was left out of the request.
In the token exchange request, on the right, can you please change {{bundle.authData.api_key}} to {{bundle.authData.key}}?
That should make sure the API key entered in the “API key” field gets passed as the key property in the request.
For a bit of context, cURL is another way you could make an HTTP request, like Zapier is doing. However, cURL is a command-line tool that you’d typically use locally on your computer. API documentation often uses cURL as a shorthand example. For our purposes, the cURL example is helpful because it shows the URL and properties we need to use in the request, but Zapier can’t run cURL directly. So we’re essentially translating the cURL example into the format Zapier uses.
Hi @connorz ,
I retried this again after validating my API and changing the field names as you described, and I’m still getting an error:
Any further suggestions?
Thanks,
J
Hey @jkirkwood001 ,
From the error, it looks like the endpoint might have changed.
I recall Galaxy Digital shared the following endpoint url: