HTML Request from Denticon - python

I am attempting to query a cloud database using the requests package. This is from Denticon, a dentistry software that my office uses to schedule patients and store information on the cloud about them and their dental history. Eventually, I would like to process and analyze the results of the query in pandas but I am having issues getting query to work at all. I admit I am a novice at using this sort of API and querying in general, so show some grace if I am doing this absolutely wrong.
By their own documentation, the makers of Denticon say you must query using a html request. When attempting to use 'request.get()' I get an error message that this method in not supported for the request when using it on a url for a specific query.
Here is some short documentation from their own website that could help fill some gaps:
Denticon API
Denticon API Getting Started
Denticon Patient APIs
In my case I am trying to query a list of patients at a specific office/location. This is what I would think to try:
import requests
apiKey = {"API-AUTH-KEY":"AAC6DB7A-5A66-4EBC-B694-D6BCD99881CB",
"API-VENDOR-KEY":"BCF756D4-DCE6-4F2B-BAAE-7679D87037A7",
"PGID":"1"}
requests.get('https://dev-api.denticon.com/v2/api/Patient/AllPatients/', headers=apiKey)
(As a short disclaimer: these are practice api keys that Denticon provides. They do not allow you query any actual patient data, just to practice using the API)
At this point is where I get the "method not supported" response for request.get

The error means that you cannot call the API using requests.get. Try to do it using requests.post.
import requests
apiKey = {"API-AUTH-KEY":"AAC6DB7A-5A66-4EBC-B694-D6BCD99881CB",
"API-VENDOR-KEY":"BCF756D4-DCE6-4F2B-BAAE-7679D87037A7",
"PGID":"1"}
json = {"OID":"","PAGEINDEX":"1"}
requests.post('https://dev-api.denticon.com/v2/api/Patient/AllPatients/', headers=apiKey, json=json)

Related

Querying Customer Saved Searches in Shopify Python API

I'm trying to get all customers who abandoned their order last week.
I was able to achieved it through the REST API, however, I wonder how to achieve the same thing via Shopify Python API.
Here's the code I tried in Postman:
https://{shop}.myshopify.com/admin/api/2019-07/customer_saved_searches/{customer_saved_search_id}/customers.json?limit=250
Also, it seems like there's a 250 results limit in the REST API, is there a way to exceed it?
The Python SDK is a bit of afterthought of Shopify. Sadly.
Regarding the paging on th REST request. Just add the query parameter ...?page=2 at the end of your URL.
Regarding the Python SDK, following will do the trick:
id = 23423423423
css = shopify.CustomerSavedSearch.find(id)

Using the Datastore API to Request Entities Through JSON

I was wondering if anyone had experience with using the Datastore API through authorized JSON requests? I'm looking at the documentation here:
https://cloud.google.com/datastore/docs/apis/v1beta2/datasets/runQuery#try-it
...and honestly, the request body is a whole lot of 'what is going on here'.
I'm simply trying to make a query. Is there no way to request say, every Section entity in my database? Its so confusing :S

Bulk XML upload for Google Blogger API

All,
I'm trying to find a way to overcome the 50 post rate limit of the Google Blogger API using the Google Python client library. The CreatePost() method fails after exactly 50 posts with a "gdata.client.RequestError: Server responded with: 400, Blog has exceeded rate limit or otherwise requires word verification for new posts" error message. It appears, however, that there may be a lower level bulk upload solution using an XML POST containing multiple blog entries. Although an example is provided in the Blogger API documentation for the XML syntax, the API is unclear how to implement a bulk upload within the context of the Python client API.
Can anyone provide any insight into this problem?

How can I query Google's Safebrowsing API to check a URL with Python?

I have a list of domains that I need to check for malware. Is there a way I could use Python to query Google's Safebrowsing API to get that information without the need for a database?
Google's Safe Browsing API page contains a Python reference client, take a look at that.

How would you query Picasa from a Google App Engine app? Data API or Url Fetch?

How would you query Picasa from a Google App Engine app? Data API or Url Fetch? What are the pros and cons of using either method?
[Edit]
I would like to be able to query a specific album in Picasa and list all the photos in it.
Code examples to do this in python are much appreciated.
Your question is a little off, since the Data API is exposed through RESTful URLs, so both methods are ultimately a "URL Fetch".
The Data API works quite well, though. It gives you access to nearly all the functionality of Picasa, and responses are sent back and forth in well-formed, well-documented XML. Google's documentation for the API is very good.
If you only need access to limited publicly available content (like a photostream) then you can do this at a very basic level by just fetching the feed url and parsing that... but even for that you can get the same data with more configuration options via the Data API URLs.
I'm not sure what code samples you'd like... it really depends what you actually want to do with Picasa.

Categories