Phil Griffiths's picture

I'm using the Turnkey orangeHRM image in AWS. I need to be able to use the API to retrieve an employee's ID and details, but can't seem to get this to work.

The API documentation seems a little sparse and although I've managed to setup the auth token, I cannot use a bearer token to login and get details back. 

So is the API fully functional in this image (ie. can I do what I need to?), and,

Is there a curl or other example of how to make a POST/PUT call?

$ curl -s -XPOST "https://orangehrm-elb.bangonabout.com/symfony/web/api/getEmployee/employ... --header "Content-Type:application/x-www-form-urlencoded" --header "Authorization: Bearer {"access_token": "81811710cf1a93e8e42175f7471fcbe9c41b1e9f"}" | python -m json.tool
{
    "error": "invalid_grant",
    "error_description": "The access token provided is invalid"
}

 

keeps coming back, but I suspect either the API won't accept this or my bearer header syntax is wrong?

Anyone able to help?

 

Thanks

Phil.

Forum: 
Jeremy Davis's picture

Unfortunately, beyond basic install I'm not very familiar with OrangeHRM at all. Also the version that we include is a little dated. It looks like there is a new stable version (3.3.3).

So I see a few possibilities:

  • The version we include has an API bug. I.e. upstream bug that has since been resolved, so now a bug in our appliance until we update.
  • The OrangeHRM API is a bit flakey. I.e. ongoing upstream bug.
  • The API is not configured properly in our appliance. I.e. a bug in our appliance.

My suggestion would be to update to the latest stable upstream version (3.3.3) and see how things go then. If it still doesn't work as it should, then I suggest that you post on their forums and hopefully someone can help you get it working properly.

If you think that it's likely a bug (regardless of who is at fault) please post an issue on our tracker. Bonus points if you can discover a resolution or workaround!

Add new comment