implement api authentications and get build status

oauth is the recommend authentication method. when generating token you can control privileges, and you do not expose your password

authentication method and crediential is provided in the engine options. see comments of the method api_json_request()