Have you tried using a basic account instead of a directory account just to see if the issue persists?
Could there be another service causing that API account to get locked out? If it is working for a short time and then stopping, it makes me think that something is causing that account to get locked.