Python/R db connection to self hosted LAMP server

Hello,

after finally setting up and running our server, we are able to connect to it through the dashboard and mobile apps. There is just small problem, the access to the sensory data.

Dashboard shows that the server should be collecting data. Patient info

Yet we were not able to access this data. We had tried to follow the instructions, both for Python (https://docs.lamp.digital/00aa707eefd54498a83e50926786ee3c) and R (https://docs.lamp.digital/46de7c8d884d4b32976e2e7021dbf3e6).

Problem is that we are not able to connect to our server. For example this line:

LAMP.connect(‘api.lamp.digital’, ‘my_email@address.com’, ‘my_password’)
when filled in with our server and auth info, gives out error with connecting to host=‘my_password’ which leads me to think either this function has parameters in different order than shown.

I tried to look to other documentations but always found just this version. Offcourse there might be some other issue, but we were not able to get data even through the R script.

Does anyone know where might be the problem and how to fix it?

I was also thinking about the credentials being wrong, do you need to log in as an admin or can you use credentials for researchers?

Thanks for all and any answers.

@sakac It looks like the issue is just the API call:

LAMP.connect(‘my_email@address.com’, ‘my_password’, ‘api.lamp.digital’)

It was in the wrong order before. The correct documentation is always available at docs.lamp.digital/api – please let me know if you have any requests or find anything amiss there!

1 Like

Thank you very much I will try it again, but the documentation seems to have a mistake for python connect as I had previously adressed.

It worked, but now while trying to run the

LAMP.Participant.all_by_researcher(“researcher”)

script, we are getting 404.api-endpoint-unimplemented, did we deploy our platform wrong or is that some non existing method? Or do we have to create our REST api methods instead?

Please use LAMP.Participant.all_by_study(STUDY_ID_HERE) and LAMP.Study.all_by_researcher(RESEARCHER_ID_HERE) instead. Also if you are admin, you can use LAMP.Researcher.all() to get the list of Researchers on your server.

1 Like

Thank you! I must have been blind, because I have not seen in docs, that it uses id as a parameter not the name.

Also I did not find the

LAMP.Participant.all_by_researcher(“me”)[‘data’]

method from the first example to be working in particular and had to change it to

LAMP.Participant.all_by_study(‘study_id’)[‘data’]

so that is maybe a little problem in docs? I am not sure, the main thing is that I was finally able to get to the data and for that I am grateful.

Thanks a lot again have a great rest of the year!

1 Like

@sakac Glad your issue was resolved! The me is actually a special variable substitution that only works if you are using credentials tied to a researcher/participant object. (But it is likely to be removed or modified someday since it’s confusing.)

Oh thanks. I might try that out now that I know this.

1 Like