Credential Your Providers

This guide describes how to Request Credentialing for your Providers

Overview

Using the Medallion API, you can request Credentialing for a Provider with just a single POST. In this guide, we'll discuss how to start such a Request, how to check in on its status, and how to get the final Credentialing File data.

Requesting Credentialing

Requesting Credentialing is as straightforward as sending a POST to the POST a Credentialing Service Request endpoint. You'll need your Organization's ID and the ID of the Provider that you want to Credential.

📘

Save your IDs!

We recommend storing IDs returned from Medallion's API to better track your Providers and Credentialing Service Requests.

If at any point you lost track of your Provider IDs, you can use the GET Providers endpoint with a search to find them again, e.g. with requests.get(providers_url, params={"search": "[email protected]"}, headers=headers).

If you've lost track of the ID of a Credentialing Service Request, you can use the GET Credentialing Service Requests endpoint with the provider_id parameter: requests.get(credentialing_srs_url, params={"provider_id": "<provider_id>"}, headers=headers).

If you've lost your Organization ID, please reach out to Medallion's Support for assistance recovering it.

import requests

base_url = "https://api.medallion.co/p/api/v1"

api_key = "<YOUR_API_KEY>"
organization_id = "<YOUR_ORG_ID>"
provider_id = "<PROVIDER_ID>"

headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "x-api-key": api_key,
}

credentialing_service_requests_url = (
    f"{base_url}/organizations/{organization_id}/credentialing-service-requests"
)
payload = {"provider_id": provider_id}

response = requests.post(
    credentialing_service_requests_url, headers=headers, json=payload
)
response.raise_for_status()
response_json = create_request_response.json()
print(response_json)

new_request_id = response_json.get("id")

Tracking the status of Credentialing Service Request

Once you've requested that Medallion Credential a Provider, you'll probably want to periodically check in on the status of that request.

🚧

Medallion is not a push-based system

As discussed in Tracking the status of Service Requests, Medallion does not offer a push-based solution for tracking the status of Service Requests. Instead, we recommend querying the status either on a cadence (e.g., daily), or as-needed.

To check the status of a Credentialing Service Request, you'll want to use the GET Credentialing Service Requests endpoint. In this case, since we already have the ID of the Service Request that we want to track, we'll filter the endpoint by the id parameter.

📘

Other filters are available!

Please be aware that there exist additional filtering options beyond the id parameter. For further information, consult the API documentation for comprehensive details.

Since we're interested in the status of the Credentialing Service Request, we'll print out the request_status field on the returned object:

response = requests.get(
    credentialing_service_requests_url,
    headers=headers,
    params={"id": request_id},
)
response.raise_for_status()
response_json = response.json()

assert len(response_json['results']) == 1
print(response_json['results'][0]['request_status'])

Checking for other Credentialing Requests that need attention

As noted above, the GET Credentialing Service Requests endpoint can be filtered by more than just Service Request ID and the Provider ID. In particular, it's common to filter for "ready" Credentialing Service Requests that "require attention."

This can be accomplished using the request_status and credentialing_status query parameters:

ready_and_needs_attention_requests_response = requests.get(
    credentialing_service_requests_url,
    headers=headers,
    params={"request_status": "ready", "credentialing_status": "needs_attention"},
)
ready_and_needs_attention_requests_response.raise_for_status()
print(ready_and_needs_attention_requests_response.json())

Getting the Credentialing File Data from a Closed File

Another frequent scenario involves obtaining complete credentialing file data from a closed Credentialing Service Request. Credentialing Files are served by the GET a Credentialing File endpoint.

🚧

Credentialing File IDs are not the same as Credentialing Service Request IDs

Note that the request_id that was returned above when creating the Request is not the same as the ID of the Credentialing File that gets created as an output of that Request. Remember to first query the GET Credentialing Service Requests endpoint with the ID of the Credentialing Service Request you're interested in to fetch the ID of the associated Credentialing File.

To retrieve the Credentialing File ID, first access the desired Credentialing Service Request using the Credentialing Service Requests endpoint and refer to the credentialing_file field, then use the GET a Credentialing File endpoint to fetch the file itself.

You can access the JSON data of the Credentialing File by referencing the provider_credentialing_file_data field in the response, or reference the pdf field for a link to the PDF document:

response = requests.get(
    credentialing_service_requests_url,
    headers=headers,
    params={"id": request_id},
)
response.raise_for_status()
response_json = response.json()

credentialing_request_data = response_json['results'][0]
if credentialing_request_data['status'] == "closed":
  credentialing_file_id = credentialing_request_data["credentialing_file"]

  credentialing_file_requests_url = (
      f"{base_url}/organizations/{organization_id}/credentialing-files"
  )
  credentialing_file_response = requests.get(
      f"{credentialing_file_requests_url}/{credentialing_file_id}", headers=headers
	)
	credentialing_file_data = credentialing_file_response.json()

  print(credentialing_file_data)
  print("JSON data:", credentialing_file_data["provider_credentialing_file_data"])
  print("PDF file URL:", credentialing_file_data["pdf"])

Code roundup

import requests

base_url = "https://api.medallion.co/p/api/v1"

api_key = "<YOUR_API_KEY>"
organization_id = "<YOUR_ORG_ID>"
provider_id = "<PROVIDER_ID>"

headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "x-api-key": api_key,
}

credentialing_service_requests_url = (
    f"{base_url}/organizations/{organization_id}/credentialing-service-requests"
)
payload = {"provider_id": provider_id}

response = requests.post(
    credentialing_service_requests_url, headers=headers, json=payload
)
response.raise_for_status()
response_json = create_request_response.json()
print(response_json)

request_id = response_json.get("id")


response = requests.get(
    credentialing_service_requests_url,
    headers=headers,
    params={"id": request_id},
)
response.raise_for_status()
response_json = response.json()

assert len(response_json['results']) == 1
print(response_json['results'][0]['request_status'])


ready_and_needs_attention_requests_response = requests.get(
    credentialing_service_requests_url,
    headers=headers,
    params={"request_status": "ready", "credentialing_status": "needs_attention"},
)
ready_and_needs_attention_requests_response.raise_for_status()
print(ready_and_needs_attention_requests_response.json())


response = requests.get(
    credentialing_service_requests_url,
    headers=headers,
    params={"id": request_id},
)
response.raise_for_status()
response_json = response.json()

credentialing_request_data = response_json['results'][0]
if credentialing_request_data['status'] == "closed":
  credentialing_file_id = credentialing_request_data["credentialing_file"]

  credentialing_file_requests_url = (
      f"{base_url}/organizations/{organization_id}/credentialing-files"
  )
  credentialing_file_response = requests.get(
      f"{credentialing_file_requests_url}/{credentialing_file_id}", headers=headers
	)
	credentialing_file_data = credentialing_file_response.json()

  print(credentialing_file_data)
  print("JSON data:", credentialing_file_data["provider_credentialing_file_data"])
  print("PDF file URL:", credentialing_file_data["pdf"])

Congratulations, you're now on your way to rapidly and securely Credentialing your Providers!