Customer API Key
-
- Posts: 10
- Joined: Mon Apr 26, 2021 6:39 pm
Customer API Key
I might be missing something in my understanding. From the API Portal I can create multiple API CustomerKeys. Those will be assigned to each individual customer. When an API call is made, an Authorization Header must be included which has the Authorization: ODFHIR {DeveloperKey}/{CustomerKey} format. Is there a way to retrieve the CustomerKey programmatically or does that have to be hard-coded in the Authorization Header for each client?
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: Customer API Key
I think that sounds about right. But I never really thought about different clients. The way I envisioned this being used was from a database driven server at the HQ of the third party using the API. It sounds like you will be calling the API from software running directly on the customer machine. Don't get me wrong. That's fine, I just have to think about it. I'm not sure if the Customer Key is available locally. If it is, you would at least need MySQL db credentials. So you still have to have some sort of local configuration. I wouldn't call the customer key or the mysql credentials "hard coded" at that point. Our team will talk about this use case on Monday and try to provide more examples and guidance.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 10
- Joined: Mon Apr 26, 2021 6:39 pm
Re: Customer API Key
You are right - in our scenario, we will probably have our software running on each client's machine (either server or workstation) that will need to call the API for data. In that case, I believe the way I understood it, each client will need to have a separate customer key that is then provided in the header for any API call. I appreciate you discussing this use case with the team - the idea would be to have it either accessible from the DB or a configuration parameter in the Registry or something like that that could then be retrieved dynamically by our software. Then it won't be hardcoded but more config driven. I will also explore your idea of using it from a database driven server and see how we can design our solution that way.
Thanks!
Thanks!
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: Customer API Key
We talked about it. The key is available in our UI, but not in our database. To show in our UI, it makes a call to our HQ server. For now, you would need to store your own config information using any normal method that you wish, including registry, ini file, xml file, database, web method, etc. We don't currently provide it in the database. But... since many third parties already seem to connect to our database, I think it would be a nice thing to add to let them grab that directly from the database. So we will talk about it again tomorrow and see if we can find a place to tuck it. I hope that we will have this available for you shortly.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 10
- Joined: Mon Apr 26, 2021 6:39 pm
Re: Customer API Key
Sounds great! Glad to hear about the plans to have it in the database somewhere.
Thanks!
Thanks!
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: Customer API Key
We're still trying to find a place in the db to put this info. I think it will probably need a new table. We'll talk about it again tomorrow to try to finalize.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com
-
- Posts: 10
- Joined: Mon Apr 26, 2021 6:39 pm
Re: Customer API Key
Following up after a long while to see if this was ever implemented where the customer key could be retrieved programmatically.
Re: Customer API Key
Good morning.
Yes it has been added! From our documentation:
This has been available since version 21.4 and we apologize for not updating this thread when it was added to our documentation.
Yes it has been added! From our documentation:
Occasionally, you may want to retrieve this information via a query. This will be rare, but can be accomplished with the following example:
SELECT CustApiKey FROM apikey WHERE DevName='YourName';
This has been available since version 21.4 and we apologize for not updating this thread when it was added to our documentation.
-
- Posts: 10
- Joined: Mon Apr 26, 2021 6:39 pm
Re: Customer API Key
That is great to hear! Kudos to the team. 
