Visa Developer Community

Highlighted
Regular Visitor

Authentication Failed

Hi

I am trying to invoke Foreign Exchange rate API using privateKey and cert.pem file 

However i get error response 401:Authentication Failed.

My code is in nodejs 10.x.

 

below is  the code snippet

uri: "https://sandbox.api.visa.com/forexrates/v1/foreignexchangerates",
key: fs.readFileSync("./privateKey.pem"),
cert: fs.readFileSync("./cert.pem"),
ca: fs.readFileSync('./DigiCertGlobalRootCA.pem'),
agent: false,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic xyz'
},
body: { "destinationCurrencyCode": currency, "markUpRate": "0", "sourceAmount": "1", "sourceCurrencyCode": baseCurrency },

 

I have followed below link

https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl

 

Please assist

5 REPLIES 5
Highlighted
Visa Dev Moderator

Re: Authentication Failed

Hey @APN_Engineering,

I've created case INC9148150 for the engineering team to investigate. We're currently working to resolve your issue and someone will get back to you soon.



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Highlighted
Visa Dev Moderator

Re: Authentication Failed

Hey @APN_Engineering,

 

Can you please try again and let us know if the issue is still happening?

 



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Highlighted
Visa Dev Moderator

Re: Authentication Failed

Hey @APN_Engineering,

 

I reached out to you previously and I haven't heard back. Can you please let us know if you're still experiencing an issue?



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Highlighted
Visa Dev Moderator

Re: Authentication Failed

Hey @APN_Engineering

 

I've reached out to you previously but haven't heard back. Feel free to reach out to us if you're interested in working together in the future. 

 



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

Thanks,
Diana

Highlighted
Dabbler

Re: Authentication Failed


@APN_Engineering wrote:

Hi

I am trying to invoke Foreign Exchange rate API using privateKey and cert.pem file 

However i get error response 401:Authentication Failed.

My code is in nodejs 10.x.

 

below is  the code snippet Tellpizzahut

uri: "https://sandbox.api.visa.com/forexrates/v1/foreignexchangerates",
key: fs.readFileSync("./privateKey.pem"),
cert: fs.readFileSync("./cert.pem"),
ca: fs.readFileSync('./DigiCertGlobalRootCA.pem'),
agent: false,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic xyz'
},
body: { "destinationCurrencyCode": currency, "markUpRate": "0", "sourceAmount": "1", "sourceCurrencyCode": baseCurrency },

 

I have followed below link

https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl

 

Please assist


Did you ever find a solution for this? I'm in the same situation. Still getting same error message.