Customer API Key

For requests or help with our API
Post Reply
achatter01
Posts: 10
Joined: Mon Apr 26, 2021 6:39 pm

Customer API Key

Post by achatter01 » Sat Nov 06, 2021 2:19 pm

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?

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Customer API Key

Post by jordansparks » Sat Nov 06, 2021 6:23 pm

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

achatter01
Posts: 10
Joined: Mon Apr 26, 2021 6:39 pm

Re: Customer API Key

Post by achatter01 » Sat Nov 06, 2021 9:51 pm

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!

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Customer API Key

Post by jordansparks » Mon Nov 08, 2021 10:47 am

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

achatter01
Posts: 10
Joined: Mon Apr 26, 2021 6:39 pm

Re: Customer API Key

Post by achatter01 » Mon Nov 08, 2021 12:34 pm

Sounds great! Glad to hear about the plans to have it in the database somewhere.

Thanks!

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Customer API Key

Post by jordansparks » Tue Nov 09, 2021 12:40 pm

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

achatter01
Posts: 10
Joined: Mon Apr 26, 2021 6:39 pm

Re: Customer API Key

Post by achatter01 » Tue Mar 28, 2023 10:30 pm

Following up after a long while to see if this was ever implemented where the customer key could be retrieved programmatically.

SLeon
Posts: 476
Joined: Mon Mar 01, 2021 10:00 am

Re: Customer API Key

Post by SLeon » Wed Mar 29, 2023 8:06 am

Good morning.

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.

achatter01
Posts: 10
Joined: Mon Apr 26, 2021 6:39 pm

Re: Customer API Key

Post by achatter01 » Wed Mar 29, 2023 9:58 am

That is great to hear! Kudos to the team. :D

Post Reply