NAV
bash javascript

Introduction

API Request and Response Specification

The Health Endeavors API conforms to the {json:api} specification. For more information on the specification please visit the json api website.

Request Examples

Examples of requests have been provided in the documentation below. These requests follow the JSON API Specification. Some of the examples will contain dot notated body parameters. The dot notation denotes nested parameters.

Content Negotiation

Clients MUST send all JSON:API data in request documents with the header Content-Type: application/vnd.api+json without any media type parameters.

Clients that include the JSON:API media type in their Accept header MUST specify the media type there at least once without any media type parameters.

Clients MUST ignore any parameters for the application/vnd.api+json media type received in the Content-Type header of response documents.

Authentication

Authorize a client to access a user account using OAuth2 password grant.

Example request:

curl -X POST "https://sandbox.healthendeavors.com/oauth/token" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -d '{"grant_type":"password","client_id":1,"client_secret":"secret","username":"jimmy","password":"mysecret"}'
const url = new URL("https://sandbox.healthendeavors.com/oauth/token");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
}

fetch(url, {
    method: "POST",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "token_type": "Bearer",
    "expires_in": 31535999,
    "access_token": "youraccesstoken",
    "refresh_token": "yourrefreshtoken"
}

HTTP Request

POST oauth/token

Body Parameters

Parameter Type Status Description
grant_type string required The grant type. This should be value: password
client_id string required The id for the given api client.
client_secret string required The secret for the given api client.
username string required The username for the account.
password string required The password for the account.
scope string optional The scopes requested.

Refreshing the user's access token.

Example request:

curl -X POST "https://sandbox.healthendeavors.com/oauth/token" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -d '{"grant_type":"refresh_token","refresh_token":"yourrefreshtoken","client_id":1,"client_secret":"secret"}'
const url = new URL("https://sandbox.healthendeavors.com/oauth/token");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
}

let body = {
    "grant_type":"refresh_token",
    "refresh_token":"yourrefreshtoken",
    "client_id":1,
    "client_secret":"secret"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "token_type": "Bearer",
    "expires_in": 31535999,
    "access_token": "youraccesstoken",
    "refresh_token": "yourrefreshtoken"
}

HTTP Request

POST oauth/token

Body Parameters

Parameter Type Status Description
grant_type string required The grant type. This should be value: refresh_token
refresh_token string required The refresh token given with your access token.
client_id string required The id for the given api client.
client_secret string required The secret for the given api client.
scope string optional Refreshing a token

Addresses

APIs for managing patient's addresses

Display a listing of the resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/addresses" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/addresses");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 4930534,
            "type": "patientaddresses",
            "attributes": {
                "address1": "1234 Disney Lane",
                "address2": "",
                "city": "Los Angeles",
                "statecode": "CA",
                "postal": "92802",
                "email": "mickeymouse@gmail.com",
                "phone": null,
                "mobile": "+14804800002",
                "fax": null,
                "ordinal": "1",
                "workphone": null
            }
        }
    ]
}

HTTP Request

GET api/patients/{patient}/addresses

Display the specified resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/addresses/{address}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/addresses/{address}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 4930534,
        "type": "patientaddresses",
        "attributes": {
            "address1": "1234 Disney Lane",
            "address2": "",
            "city": "Los Angeles",
            "statecode": "CA",
            "postal": "92802",
            "email": "mickeymouse@gmail.com",
            "phone": null,
            "mobile": "+14804800002",
            "fax": null,
            "ordinal": "1",
            "workphone": null
        }
    }
}

HTTP Request

GET api/patients/{patient}/addresses/{address}

Drug Ingredients

APIs for managing drug ingredients

Display a listing of the resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/drugs/{drug}/ingredients" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/drugs/{drug}/ingredients");

    let params = {
            "page": "3",
            "per_page": "16",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
  "data": [
    {
      "id": 1,
      "type": "drugingredients",
      "attributes": {
        "name": "HUMAN PAPILLOMAVIRUS TYPE 6 L1 CAPSID PROTEIN ANTIGEN",
        "activenumeratorstrength": "20",
        "activeingredientunit": "ug/.5mL"
      }
    },
    {
      "id": 2,
      "type": "drugingredients",
      "attributes": {
        "name": "HUMAN PAPILLOMAVIRUS TYPE 11 L1 CAPSID PROTEIN ANTIGEN",
        "activenumeratorstrength": "40",
        "activeingredientunit": "ug/.5mL"
      }
    },
    {
      "id": 3,
      "type": "drugingredients",
      "attributes": {
        "name": "HUMAN PAPILLOMAVIRUS TYPE 16 L1 CAPSID PROTEIN ANTIGEN",
        "activenumeratorstrength": "40",
        "activeingredientunit": "ug/.5mL"
      }
    },
    {
      "id": 4,
      "type": "drugingredients",
      "attributes": {
        "name": "HUMAN PAPILLOMAVIRUS TYPE 18 L1 CAPSID PROTEIN ANTIGEN",
        "activenumeratorstrength": "20",
        "activeingredientunit": "ug/.5mL"
      }
    }
  ],
  "links": {
    "first": "api/patients/4385806/drugs/00006410902/ingredients?page=1",
    "last": "api/patients/4385806/drugs/00006410902/ingredients?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "path": "api/patients/4385806/drugs/00006410902/ingredients",
    "per_page": 15,
    "to": 4,
    "total": 4
  }
}

HTTP Request

GET api/patients/{patient}/drugs/{drug}/ingredients

Query Parameters

Parameter Status Description
page optional The page number to return
per_page optional The number of items per page(max 100)

Display the specified resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/drugs/{drug}/ingredients/{ingredient}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/drugs/{drug}/ingredients/{ingredient}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
  "data": {
    "id": 1,
    "type": "drugingredients",
    "attributes": {
      "name": "HUMAN PAPILLOMAVIRUS TYPE 6 L1 CAPSID PROTEIN ANTIGEN",
      "activenumeratorstrength": "20",
      "activeingredientunit": "ug/.5mL"
    }
  }
}

HTTP Request

GET api/patients/{patient}/drugs/{drug}/ingredients/{ingredient}

Drugs

APIs for managing drugs

Display a listing of the resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/drugs" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/drugs");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
   "data":[
      {
         "id":527134510,
         "type":"drugs",
         "attributes":{
            "clmsrvcprvdrgnrcid":"999999999999999",
            "packagendc":"0527-1345-10",
            "prvdrsrvcidqlfyrcd":"1",
            "clmdawprodslctncd":"0",
            "clmlinefromdt":"2014-10-01",
            "clmlinesrvcunitqty":"90.0000",
            "clmlinedayssuplyqty":"90.0000",
            "prvdrprsbngidqlfyrcd":"1",
            "clmlinebenepmtamt":".0000",
            "clmprsbngprvdrgnrcidnum":"999999999999999",
            "productndc":"0527-1345",
            "ndcpackagecode":"0527-1345-10",
            "cmsndccode":"00527134510",
            "description":"1000 TABLET in 1 BOTTLE, PLASTIC (0527-1345-10) ",
            "proprietaryname":"Levothyroxine Sodium",
            "proprietarysuffix":"",
            "name":"Levothyroxine Sodium",
            "dosagename":"TABLET",
            "producttypename":"HUMAN PRESCRIPTION DRUG",
            "labelername":"Lannett Company, Inc."
         }
      },
      {
         "id":172208380,
         "type":"drugs",
         "attributes":{
            "clmsrvcprvdrgnrcid":"999999999999999",
            "packagendc":"0172-2083-80",
            "prvdrsrvcidqlfyrcd":"1",
            "clmdawprodslctncd":"0",
            "clmlinefromdt":"2016-09-01",
            "clmlinesrvcunitqty":"30.0000",
            "clmlinedayssuplyqty":"30.0000",
            "prvdrprsbngidqlfyrcd":"1",
            "clmlinebenepmtamt":".0000",
            "clmprsbngprvdrgnrcidnum":"999999999999999",
            "productndc":"0172-2083",
            "ndcpackagecode":"0172-2083-80",
            "cmsndccode":"00172208380",
            "description":"1000 TABLET in 1 BOTTLE (0172-2083-80) ",
            "proprietaryname":"Hydrochlorothiazide",
            "proprietarysuffix":"",
            "name":"Hydrochlorothiazide",
            "dosagename":"TABLET",
            "producttypename":"HUMAN PRESCRIPTION DRUG",
            "labelername":"Teva Pharmaceuticals USA, Inc."
         }
      }
   ],
   "links":{
      "first":"api\/patients\/4383554\/drugs?page=1",
      "last":"api\/patients\/4383554\/drugs?page=2",
      "prev":null,
      "next":"api\/patients\/4383554\/drugs?page=2"
   },
   "meta":{
      "current_page":1,
      "from":1,
      "last_page":1,
      "path":"api\/patients\/4383554\/drugs",
      "per_page":15,
      "to":15,
      "total":2
   }
}

HTTP Request

GET api/patients/{patient}/drugs

See request examples for more information.

Query Parameters

Parameter Status Description
page optional The page number to return
per_page optional The number of items per page(max 100)
filter.startdate optional The start date filter
filter.enddate optional The end date filter

Display the specified resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/drugs/{drug}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/drugs/{drug}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
   "data":{
      "id":172208380,
      "type":"drugs",
      "attributes":{
         "clmsrvcprvdrgnrcid":"999999999999999",
         "packagendc":"0172-2083-80",
         "prvdrsrvcidqlfyrcd":"1",
         "clmdawprodslctncd":"0",
         "clmlinefromdt":"2014-04-01",
         "clmlinesrvcunitqty":"15.0000",
         "clmlinedayssuplyqty":"15.0000",
         "prvdrprsbngidqlfyrcd":"1",
         "clmlinebenepmtamt":".0000",
         "clmprsbngprvdrgnrcidnum":"999999999999999",
         "productndc":"0172-2083",
         "ndcpackagecode":"0172-2083-80",
         "cmsndccode":"00172208380",
         "description":"1000 TABLET in 1 BOTTLE (0172-2083-80) ",
         "proprietaryname":"Hydrochlorothiazide",
         "proprietarysuffix":"",
         "name":"Hydrochlorothiazide",
         "dosagename":"TABLET",
         "producttypename":"HUMAN PRESCRIPTION DRUG",
         "labelername":"Teva Pharmaceuticals USA, Inc."
      }
   }
}

HTTP Request

GET api/patients/{patient}/drugs/{drug}

Patients

APIs for managing patients

Display a listing of the resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 4385806,
            "type": "patients",
            "attributes": {
                "firstname": "Mickey",
                "lastname": "Mouse",
                "gender": "m",
                "dob": "1900-01-01"
            }
        },
        {
            "id": 4954039,
            "type": "patients",
            "attributes": {
                "firstname": "Donald",
                "lastname": "Duck",
                "gender": "m",
                "dob": "1900-01-02"
            }
        },
        {
            "id": 4954483,
            "type": "patients",
            "attributes": {
                "firstname": "Scooby",
                "lastname": "Doo",
                "gender": "m",
                "dob": "1900-01-03"
            }
        }
    ],
    "links": {
        "first": "api\/patients?page=1",
        "last": "api\/patients?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "api\/patients",
        "per_page": 25,
        "to": 3,
        "total": 3
    }
}

HTTP Request

GET api/patients

Display the specified resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 4385806,
        "type": "patients",
        "attributes": {
            "firstname": "Mickey",
            "lastname": "Mouse",
            "gender": "m",
            "dob": "1900-01-01"
        }
    }
}

HTTP Request

GET api/patients/{patient}

Providers

APIs for managing providers

Display a listing of the resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/providers" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/providers");

    let params = {
            "page": "8",
            "per_page": "12",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
   "data":[
      {
         "id":1093938128,
         "type":"providers",
         "attributes":{
            "organizationname":"MARVEL UNIVERSE",
            "name":"CAPTAIN AMERICA",
            "address1":"1 AVENGERS LANE",
            "address2":null,
            "city":"NEW YORK CITY",
            "state":"NY",
            "zip":"100195694",
            "phone":"5555555552",
            "fax":"5555555553",
            "firstvisit":"2018-02-10",
            "lastvisit":"2018-02-10",
            "claimcount":"1",
            "lastrole":"prescriber",
            "primarytaxonomyclassification":"Family Medicine"
         }
      },
      {
         "id":1225029804,
         "type":"providers",
         "attributes":{
            "organizationname":"DC UNIVERSE",
            "name":"BATMAN",
            "address1":"1007 MOUNTAIN DRIVE",
            "address2":null,
            "city":"GOTHAM",
            "state":"NJ",
            "zip":"073025599",
            "phone":"5555555555",
            "fax":"5555555556",
            "firstvisit":"2016-02-25",
            "lastvisit":"2016-02-25",
            "claimcount":"1",
            "lastrole":"servicer",
            "primarytaxonomyclassification":"Pharmacy"
         }
      }
   ],
   "links":{
      "first":"api\/patients\/4385806\/providers?page=1",
      "last":"api\/patients\/4385806\/providers?page=2",
      "prev":null,
      "next":"api\/patients\/4385806\/providers?page=2"
   },
   "meta":{
      "current_page":1,
      "from":1,
      "last_page":1,
      "path":"api\/patients\/4385806\/providers",
      "per_page":15,
      "to":15,
      "total":2
   }
}

HTTP Request

GET api/patients/{patient}/providers

Query Parameters

Parameter Status Description
page optional The page number to return
per_page optional The number of items per page(max 100)

Display the specified resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/patients/{patient}/providers/{provider}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/patients/{patient}/providers/{provider}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
   "data":{
      "id":1093938128,
      "type":"providers",
      "attributes":{
         "organizationname":"MARVEL UNIVERSE",
         "name":"CAPTAIN AMERICA",
         "address1":"1 AVENGERS LANE",
         "address2":null,
         "city":"NEW YORK CITY",
         "state":"NY",
         "zip":"100195694",
         "phone":"5555555552",
         "fax":"5555555553",
         "firstvisit":"2018-02-10",
         "lastvisit":"2018-02-10",
         "claimcount":"1",
         "lastrole":"prescriber",
         "primarytaxonomyclassification":"Family Medicine"
      }
   }
}

HTTP Request

GET api/patients/{patient}/providers/{provider}

Users

APIs for managing users.

Display a listing of the resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/users" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/users");

    let params = {
            "page": "4",
            "per_page": "3",
        };
    Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 2101,
            "type": "users",
            "attributes": {
                "name": "Jimmy Johns",
                "email": "jimmy.johns@email.org",
                "created_at": "2019-02-15 18:17:22.880",
                "updated_at": "2019-02-15 18:17:22.880"
            }
        },
        {
            "id": 2105,
            "type": "users",
            "attributes": {
                "name": "Fred Smith",
                "email": "fred.smith@email.org",
                "created_at": "2019-02-15 18:19:09.823",
                "updated_at": "2019-02-15 20:00:29.843"
            }
        }
    ],
    "links": {
        "first": "http:\/\/sandbox.healthendeavors.com\/api\/users?page=1",
        "last": "http:\/\/sandbox.healthendeavors.com\/api\/users?page=416",
        "prev": null,
        "next": "http:\/\/sandbox.healthendeavors.com\/api\/users?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 416,
        "path": "http:\/\/sandbox.healthendeavors.com\/api\/users",
        "per_page": 2,
        "to": 2,
        "total": 832
    }
}

HTTP Request

GET api/users

Query Parameters

Parameter Status Description
page optional The page number to return
per_page optional The number of items per page(max 100)

Store a newly created resource in storage.

Example request:

curl -X POST "https://sandbox.healthendeavors.com/api/users" \
    -H "Content-Type: application/json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken" \
    -d '{"data":{"attributes":{"email":"john.jones@gmail.com","name":"John Jones","password":"rEoRzvIf0HebToW3"},"type":"users"}}'
const url = new URL("https://sandbox.healthendeavors.com/api/users");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

let body = {
    "data": {
        "attributes": {
            "email": "john.jones@gmail.com",
            "name": "John Jones",
            "password": "rEoRzvIf0HebToW3"
        },
        "type": "users"
    }
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (201):

{
    "data": {
        "id": 5067,
        "type": "users",
        "attributes": {
            "email": "john.jones@gmail.com",
            "name": "John Jones",
            "updated_at": "2019-02-22 22:12:27.406",
            "created_at": "2019-02-22 22:12:27.406"
        }
    }
}

HTTP Request

POST api/users

Body Parameters

Parameter Type Status Description
data.attributes.email string required The email of the user.
data.attributes.name string required The name of the user.
data.attributes.password string required The password for the user.
data.type string required The type of the resource.

Note: data.attributes.email must be unique, but does not need to be a valid email.

Display the specified resource.

Example request:

curl -X GET -G "https://sandbox.healthendeavors.com/api/users/{user}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/users/{user}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 4,
        "type": "users",
        "attributes": {
            "name": "John Jones",
            "email": "john.jones@gmail.com",
            "created_at": "2019-02-18 18:11:17.143",
            "updated_at": "2019-02-18 18:11:17.143"
        }
    }
}

HTTP Request

GET api/users/{user}

Update the specified resource in storage.

Example request:

curl -X PUT "https://sandbox.healthendeavors.com/api/users/{user}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken" \
    -d '{"data":{"attributes":{"email":"john.jones@outlook.com","name":"John Jones","password":"VEYLo80iV26HIOp7"},"type":"Q4dWWI3IYvPWXCil"}}'
const url = new URL("https://sandbox.healthendeavors.com/api/users/{user}");

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

let body = {
    "data": {
        "attributes": {
            "email": "john.jones@outlook.com",
            "name": "John Jones",
            "password": "VEYLo80iV26HIOp7"
        },
        "type": "Q4dWWI3IYvPWXCil"
    }
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 2421,
        "type": "users",
        "attributes": {
            "name": "John Jones",
            "email": "john.jones@outlook.com",
            "created_at": "2019-02-18 18:11:17.143",
            "updated_at": "2019-02-22 22:12:27.483"
        }
    }
}

HTTP Request

PUT api/users/{user}

PATCH api/users/{user}

Body Parameters

Parameter Type Status Description
data.attributes.email string optional The email of the user.
data.attributes.name string optional The name of the user.
data.attributes.password string optional The password for the user.
data.type string required The type of the resource.

Remove the specified resource from storage.

Example request:

curl -X DELETE "https://sandbox.healthendeavors.com/api/users/{user}" \
    -H "Content-Type: application/vnd.api+json" \
    -H "Accept: application/vnd.api+json" \
    -H "Authorization: Bearer youraccesstoken"
const url = new URL("https://sandbox.healthendeavors.com/api/users/{user}");

let headers = {
    "Content-Type": "application/vnd.api+json",
    "Accept": "application/vnd.api+json",
    "Authorization": "Bearer youraccesstoken",
}

fetch(url, {
    method: "DELETE",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [],
    "meta": {
        "user": {
            "id": 2421,
            "deleted_at": {
                "date": "2019-02-22 22:12:27.499863",
                "timezone_type": 3,
                "timezone": "UTC"
            }
        }
    }
}

HTTP Request

DELETE api/users/{user}