Rest API - Conection Refused

Hi,

I’m trying to follow the instructions about connection with the Rest API, but when I try the first step for getting the API token, an error of connection refused occurs with that command:

curl -X POST -H ‘Content-Type: application/json’ ‘https://localhost:8300/apis/api/auth
-d ‘{
“grant_type”:“password”,
“username”: “ServiceUser”,
“password”: “password”,
“scope”:“site id”
}’

I’m using an EC2 instance, so instead of “Localhost” i’m putting the public IP of it. In the fields of username and password, i’m typing the username and password that i’m created when ran the setup of OpenEMR, and in scope, I let “default”. The source that i’m installed comes from the Sourgeforge.

I noticed that the path mentioned in the command line " /apis/api/auth " doens’t exists in the actual source files. The folder Apis in the source only contains 2 files:

.htaccess
dispatch.php

Is that a problem?

Looking forward a reply
Thanks

Hi @Mateus,

please find below link and check the solution Cannot get API to work

Thanks,
Nilesh

Hi @Nilesh_Hake,

Thanks for the reply, I made the modifications in my Apache config File, but still can’t connect.

image

I also tried to connect via localhost direct in the server, but it doesn’t work too.

There is something else I can try?