API Key as Custom Bridge command line arg

For requests or help with our API
Post Reply
User avatar
dcrider
Posts: 67
Joined: Sun Sep 29, 2019 11:03 am
Contact:

API Key as Custom Bridge command line arg

Post by dcrider » Wed Jul 06, 2022 1:56 pm

Is it currently possible to send the client's API key as a command-line arg to a custom bridge? I didn't see it listed on the Output File page (https://opendental.com/manual/programli ... tfile.html)

Or is there a better way to access that from a custom bridge so I don't have to keep a copy of it saved in a text file somewhere?

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

Re: API Key as Custom Bridge command line arg

Post by SLeon » Thu Jul 07, 2022 8:21 am

Because a dental office could be using multiple third party software programs, and therefore be associated with multiple API keys, we cannot simply add API Key as a Replacement Field to the Program Link Output File window.

You can query this information directly from the customer's database, however, using the query below. See the API Key section of our API Setup page for additional information on this table.

Code: Select all

SELECT CustApiKey FROM apikey WHERE DevName='YourName';

User avatar
dcrider
Posts: 67
Joined: Sun Sep 29, 2019 11:03 am
Contact:

Re: API Key as Custom Bridge command line arg

Post by dcrider » Fri Jul 08, 2022 8:52 am

It is my understanding that in order to call /queries/ShortQuery to be able to get the CustApiKey that I would first need to have the CustApiKey in order to add it to the authorization header.

Is there a way to get that key with just the developer's key?

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

Re: API Key as Custom Bridge command line arg

Post by SLeon » Fri Jul 08, 2022 9:31 am

The query can be run outside of the API. As the developer, you should be able to view all of your customer's API Keys when you are logged in to the Developer Portal website. Because you have to generate and give this key to the customer, most developers will also enter this into their software when it is installed at the customer's machine.

User avatar
dcrider
Posts: 67
Joined: Sun Sep 29, 2019 11:03 am
Contact:

Re: API Key as Custom Bridge command line arg

Post by dcrider » Fri Jul 08, 2022 10:25 am

Thank you for the clarification.

If a customer's API key is disabled by the developer, I'm assuming all requests are returned with 401 - Unauthorized, is that correct? Does the apikey table also get updated when that happens?

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

Re: API Key as Custom Bridge command line arg

Post by SLeon » Fri Jul 08, 2022 10:41 am

Yes. If a customer's API Key has been disabled by the developer, any API request will return "401 - API key has been disabled by the developer".

The apikey table in the customer's database will still, however, contain this disabled key for a period of time. Their local table is refreshed whenever the customer opens the API Setup window in Open Dental.

Post Reply