What type of authentication are you using for REST? - I guess basic, correct? See more details about REST request authentication: https://docs.kentico.com/k12/integrating-3rd-party-systems/kentico-rest-service/authenticating-rest-requests
As long as you're getting 401 (unauthorized) status it seems that user you're using for request authorization is not allowed to access custom table data. The easiest way to verify it is to login into Kentico with that user and try to get to that custom table data. Most like you need to setup permissions for the user.