---
title: "Custom REST API Integration"
canonical: "https://wiki.patientsknowbest.com/space/api/3363897377/Custom%20REST%20API%20Integration"
format: markdown
---
> Macro (pagetree)



> Macro (toc)

The Custom REST API allows developers to quickly and easily interact with PKB functionality in a programmatic way, including accessing patient medical records. We are currently in the process of moving to a[ ](https://dev.patientsknowbest.com/home/fhir-api)<u>[FHIR compliant REST API](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/3363602489)</u>.

# Quick Start

- <u>[Connectivity](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/3363995659)</u>
- <u>[Request access](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/3365013163)</u>
- Specification: <u>[Endpoints](https://sandbox.patientsknowbest.com/swagger-ui/index.html#/)</u>

# Specification

Please see[ ](https://www.google.com/url?q=https%3A%2F%2Fsandbox.patientsknowbest.com%2Fapi%2Findex.html&sa=D&sntz=1&usg=AOvVaw1yUD3Ficpm4OqvcqR61On2)<u>[here for our auto-generated Swagger documentation](https://sandbox.patientsknowbest.com/swagger-ui/index.html#/)</u>.

# Test with Postman

There are many tools available to test REST APIs; we've had good experiences working with Postman:[ ](http://www.google.com/url?q=http%3A%2F%2Fwww.postman.com&sa=D&sntz=1&usg=AOvVaw1gC5TrJUlq3EgxWikMlVo8)<u>[http://www.postman.com](http://www.google.com/url?q=http%3A%2F%2Fwww.postman.com&sa=D&sntz=1&usg=AOvVaw1gC5TrJUlq3EgxWikMlVo8)</u>

# Example

This example demonstrates how to search for a patient's diagnoses based on their known PKB ID.

1. Generate an access token by following the <u>[OAuth 2.0 walkthrough](https://wiki.hub.patientsknowbest.com/wiki/spaces/api/pages/3365078610)</u>
  1. The example below assumes you have been granted an access token of: **aaaaa-bbbbb**
2. Confirm the PKB ID of the patient whose appointments you want to search for
  1. The example below assumes a PKB ID of: **123**
3. Make the call as detailed below, replacing the access token and PKB ID with your own values
4. The patient's diagnoses will be returned in the response

## Example Request

This example is written for http://sandbox.patientsknowbest.com; replace the URL as needed if you are connecting to a different environment.

curl -X GET --header "Accept: application/json" --header "Authorization: Bearer **aaaaa-bbbbb**" "https://sandbox.patientsknowbest.com/json/v2-beta/diagnoses/forPatient/**123**"