Limit access to the API


I want to limit the access to the API by having one service account (system user) only executing one set of scripts and Another service account executing Another set of script. Neither service account should be able to execute the other set of scripts.

I've created two new program functions and two permission groups and assigned my two users to different permission Groups.

If I try to do this internally (logged in to the AppServer and executing the script) and externally (from ServiceNow), they both get "You are not allowed to use that feature."

Please help!