Testing certain functionality

For requests or help with our API
Post Reply
User avatar
cridertechdev
Posts: 6
Joined: Wed Jan 04, 2023 9:27 am
Contact:

Testing certain functionality

Post by cridertechdev » Mon Apr 03, 2023 3:14 pm

Are all methods allowed/implemented in the database that we can access with the test credentials provided here: https://www.opendental.com/site/apisetup.html (Under the Authorization header)?

I've been getting the error "Content-Type must be application/json." even though I clearly set this header. I am able to query patients without issue, but when I try to POST a payment, I get this error.

I'm really hoping it's just not available in the testing environment because I can't think of anything else that might be the issue in my code. I even had ChatGPT review my code and it recommended I reach out the API developers because there's nothing in my code that should elicit such a response.
Daylon Crider,
Owner at Crider Technologies LLC
https://paymentbridge.cridertechnologies.com

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

Re: Testing certain functionality

Post by SLeon » Mon Apr 03, 2023 3:27 pm

Good afternoon,

Yes, the credentials listed on the Setup page of our documentation has all API permissions available and has access to all API methods.

I have just sent a request using those credentials to make sure. The first one I sent was with Postman (which can obfuscate its default header values) and the other with curl (which requires you to explicitly specify headers).

Patients_POST_curl.gif
Patients_POST_curl.gif (16.16 KiB) Viewed 2813 times

Can you please include a copy of the request you are sending?

User avatar
cridertechdev
Posts: 6
Joined: Wed Jan 04, 2023 9:27 am
Contact:

Re: Testing certain functionality

Post by cridertechdev » Mon Apr 03, 2023 3:49 pm

Absolutely. I just tried again using this request:

url: https://api.opendental.com/api/v1/payments
headers: {
"Authorization": "ODFHIR NFF6i0KrXrxDkZHt/VzkmZEaUWOjnQX2z",
"Content-Type":"application/json"
}
body:{
"PayAmt": "76.89",
"PatNum": 15,
"PayDate": "2023-04-03",
"PayNote": "Payment taken via mobile app",
"isPatientPreferred": "true"
}

I'm using Dart's http.post() method in my mobile app. The credentials above are the test creds from my original post.
Daylon Crider,
Owner at Crider Technologies LLC
https://paymentbridge.cridertechnologies.com

User avatar
cridertechdev
Posts: 6
Joined: Wed Jan 04, 2023 9:27 am
Contact:

Re: Testing certain functionality

Post by cridertechdev » Mon Apr 03, 2023 3:52 pm

I think I answered my own question. Dart's http.post() method overrides all headers. I'll have to look into a workaround.
Daylon Crider,
Owner at Crider Technologies LLC
https://paymentbridge.cridertechnologies.com

Post Reply