Why am I receiving a 401 error in the PayHere test request step?

This topic was automatically generated from Slack. You can find the original thread here.

Evyn Ecclesia : RE: Authentication: ErrorRequest failed with status code 401

If I’ve already entered my API Key, why am I getting the following result:
{
“error”: “You need to sign in or sign up before continuing.”
}

Tod Sacerdoti : Evyn - can you provide a bit more information about your error. are you using a specific app or action?

Evyn Ecclesia : Yes Tod…NP.
I’m currently testing my PD Webhook on my PayHere*(PH)* “Sandbox” Account.

Whenever PH sends a request, I’ve setup
a PD Trigger to get it, then run next steps.

So the very next step is an Auth Step for PH, --where I’m getting the error (Ref Screenshot #1).

But based on PH’s Documentation (Ref Screenshots #2 & #3), I may be using the wrong key, or failing to enter some additional required info into this step.

Hope this helps to clarify. Please Advise.

I’ve attached 3 Screenshots

Tod Sacerdoti : can you share the screenshots…i don’t see them attached

Tod Sacerdoti : Payhere is a brand new integration so its definitely possible there is something we need to look into

Evyn Ecclesia :

Evyn Ecclesia : Ok Tod. I’ve resubmitted them above.

Tod Sacerdoti : Hmm…i tested end to end on my side and didn’t encounter the same issue. Can you clarify what you mean by Sandbox?

Tod Sacerdoti : Is it possible that your sandbox account doesn’t have access to the production API?

Tod Sacerdoti : Yes, I was able replicate. If you want to make calls to the sandbox API, you need to change https://app.payhere.co/api/v1/user to <https://sandbox.payhere.co/api/v1/user>

Tod Sacerdoti : I added support for sandbox or production in the auth setup:

Evyn Ecclesia : Ok. Thanks Tod.
Also, I haven’t been getting notified to my Desktop - which is why my responses have been delayed.

My Slack settings have already been updated
to receive notifications w/sound effects.

Are there some other settings that need to be considered to make my Slack notifies work?

Thanks again and please advise.

Tod Sacerdoti : Not sure on the Slack side but I am sure the answer is online somewhere.

Evyn Ecclesia : Hi Tod.

How do I access your updated changes?

I tried deleting, and re-adding the PH Auth Step, but I’m not seeing
the Sandbox/Production options?

Please advise.

Tod Sacerdoti : if you refresh your client you should see it if you add the action again

Evyn Ecclesia : Ok. Still getting “401 error”
Ref (2) Screenshots of my TestRun @ 11:07am.
Note in 1st Screenshot:
Before the run, SandBox is added to Link

Note in 2nd Screenshot:
After the run, Sandbox has been removed from
Link, and errors out.

Please advise.

Evyn Ecclesia : I Created a new Auth Link named “SANDBOX REV” -which picks up your newly added changes,
but once the step is run, it looks like it’s reverting back to the old Auth Link named “SANDBOX.”

Evyn Ecclesia : Do I still need to refresh my client as you suggested above, or is there something else going on?

Evyn Ecclesia : Hi Tod. Another observation…

I’ve captured a Side-by-Side Screenshot below…

…And there appears to be a discrepancy btwn
my Connected Accounts vs Auth Step connect.

Shouldn’t the SANDBOX REV be showing up
as “connected” in the Connected Accts Screenshot?

Shouldn’t updates to connections at the step level, be automatically updated and show up
in the Connected Accts Menu Option?

Hopes this sheds more light onto the problem,
as it appears that the Accts Menu Option
is overriding the connection being declared
in the Auth Step at run Time.

Please advise.

Tod Sacerdoti : Have you deployed that workflow? The bar at the top implies it needs to deploy.