Paypal API call using Node.js returns 401 unauthorized

I am trying to make a test call to PayPal payment API through my Node.js application. So I followed the following steps:

  1. Accessed https://developer.paypal.com/ and logged in with my PayPal live account and password.
  2. After login, clicked on Dashboard -> Sandbox Accounts -> Create Account
  3. Created two test accounts (one Business/ seller and the other is Personal / Buyer).
  4. Used the PayPal REST API SDK for nodejs inside my application where I've used the exact code provided in their example here except for the ClientID and Secret, which I have changed to that of the new Business/ Seller test account which I've created.

But for some reason calls to .create API endpoint return 401 - Unauthorized. So can someone please help me by telling me what I am missing / doing wrong here? Thanks