Developer Hub

Let's build health apps together that do good at scale

Get Started

Starting with APIs

The following sections explain more about the different kinds of operations that can be performed with HealthTap Cloud APIs.

Reading

All health data and information can be read simply with an HTTP GET request to the relevant endpoint. For example, if you want to retrieve basic profile information about the current user, you would make an HTTP GET request as below:

GET /api/v2.1/users/me.json  HTTP/1.1 
Host: api.healthtap.com

Most API calls must be signed with an access token. You determine which scopes are needed in this access token by looking at Handling Authentication for the data that you wish to read. You can also use the API Reference to quickly explore and play with the API to discover how it works.

The responses you will receive vary based on the data you are reading, but they take the following general form:

 {
   "fieldname": {field-value},
   ....
}

The sample response for current user basic profile:

{
  "link": {
    "self": "https://www.healthtap.com"
  },
  "data": {
    "photo": {
      "large": "https://www.healthtap.com/images/avatars/gallery/member45_medium.png",
      "thumb": "https://www.healthtap.com/images/avatars/gallery/member45_thumb.png"
    },
    "type": "Person",
    "location": {
      "city": "Palo Alto",
      "state": "CA",
      "postcode": "94301"
    },
    "person_id": "850de72540eb434fb631e6a7a9073b1d",
    "gender": "female",
    "dob": 757929600,
    "given_name": "Jenny",
    "family_name": "Smith",
    "locale": "en-US"
  }
}

Publishing

Most of the data in the HealthTap Cloud API can be publishing targets, such as health questions and doctor appointments. All HealthTap Cloud API publishing is done with an HTTP POST request to the relevant endpoint with any necessary parameters included. For example, to ask doctors a question on behalf of someone, you would make an HTTP POST request as shown below:

POST api.healthtap.com
  /api/v2.1/questions.json

Sample request to post a question:

{
  "data": {
    "question_type": "regular",
    "external_question_id": "22",
    "question": "Can I eat sushi during pregnancy if I'm a diabetic?"
  }
}

All publishing must be signed with an access token. You determine which scopes are needed in this access token by looking at Handling Authentication for the data that you wish to publish

A large number of endpoints that can be publishing targets. Details can be found in the HealthTap Cloud API Reference for each endpoint.

Updating

All HealthTap Cloud API updating is done with an HTTP POST request to the relevant endpoint with any updated parameters included:

POST api.healthtap.com
  /api/v2.1/users/me/health_metrics.json

Sample request to update health_metrics:

{
  "data": {
    "metrics": [
      {
        "name": "heart_rate",
        "source_category": " ",
        "unit": "bpm",
        "data": [
          {
            "start_ts": 1400000000,
            "value": 120,
            "duration": 3600,
            "details": "running"
          }
        ]
      }
    ]
  }
}

All updating must be signed with an access token. You determine which scopes are needed in this access token by looking at Handling Authentication for the data that you wish to update.

Searching

You can search many objects in the HealthTap Cloud with APIs like the /search endpoint. The syntax for search is:

GET api.healthtap.com
  /api/v2.1/search.json?
    q={your-query}&
    category={object-type}

All HealthTap Cloud search queries require an access token included in the request. You determine which scopes are needed in this access token by looking at Handling Authentication for the data that you wish to search.

Sample request:

GET api.healthtap.com
  /api/v2.1/search.json?
    q=headache&
    type=questions

Starting with APIs