Difference between revisions of "Internal Caregiver API Subsystem"

From GrandCare Systems
Jump to navigation Jump to search
(Created page with "The Caregiver subsystem allows you to create, view, edit and delete caregivers from a system via GCAPI. = Operations = == create == Create a caregiver === Parameters === *...")
 
m (Added Internal to GCAPI)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The Caregiver subsystem allows you to create, view, edit and delete caregivers from a system via [[GCAPI]].
The Caregiver subsystem allows you to create, view, edit and delete caregivers from a system via [[Internal GCAPI]].
= Operations =
= Operations =
== create ==
== create ==
Line 6: Line 6:
* ''firstname'' - [required] - First name
* ''firstname'' - [required] - First name
* ''lastname'' - [required] - Last name
* ''lastname'' - [required] - Last name
* ''nickname'' - [optional] - Nick name
* ''id'' - [optional] - Unique ID in UUID format
* ''id'' - [optional] - Unique ID in UUID format
* ''email'' - [optional] - Email address
* ''email'' - [optional] - Email address
* ''address'' - [optional] - Street address
* ''address'' - [optional] - Street address
* ''address2'' - [optional] - Street address2
* ''city'' - [optional] - City
* ''city'' - [optional] - City
* ''state'' - [optional] - State
* ''state'' - [optional] - State / Region / Province
* ''zip'' - [optional] - Zip code
* ''zip'' - [optional] - Zip code
* ''country'' - [optional] - ISO3166 Country Code
* ''homephone'' - [optional] - Home phone number
* ''homephone'' - [optional] - Home phone number
* ''workphone'' - [optional] - Work phone number
* ''workphone'' - [optional] - Work phone number
Line 27: Line 30:
  <firstname>Nicholas</firstname>
  <firstname>Nicholas</firstname>
  <lastname>Hall</lastname>
  <lastname>Hall</lastname>
<nickname> </nickname>
  <address>123 Fake St</address>
  <address>123 Fake St</address>
<address2> </address2>
  <city>West Bend</city>
  <city>West Bend</city>
<country> </country>
  <state>WI</state>
  <state>WI</state>
  <zipcode>53095</zipcode>
  <zipcode>53095</zipcode>
Line 48: Line 54:
             "firstname": "Nicholas",
             "firstname": "Nicholas",
             "lastname": "Hall",
             "lastname": "Hall",
            "nickname": " ",
             "address": "123 Fake St",
             "address": "123 Fake St",
            "address2": " ",
             "city": "West Bend",
             "city": "West Bend",
             "state": "WI",
             "state": "WI",
             "zipcode": "53095",
             "zipcode": "53095",
            "country": " ",
             "homephone": " ",
             "homephone": " ",
             "workphone": " ",
             "workphone": " ",
Line 110: Line 119:


== update ==
== update ==
Updates a caregiver
Updates an existing caregiver
=== Parameters ===
=== Parameters ===
* ''id'' - [required] - ID of caregiver to update
* ''id'' - [required] - ID of caregiver to update
* ''firstname'' - [optional] - First name
* ''firstname'' - [optional] - First name
* ''lastname'' - [optional] - Last name
* ''lastname'' - [optional] - Last name
* ''nickname'' - [optional] - Nick name
* ''email'' - [optional] - Email address
* ''email'' - [optional] - Email address
* ''address'' - [optional] - Street address
* ''address'' - [optional] - Street address
* ''address2'' - [optional] - Street address2
* ''city'' - [optional] - City
* ''city'' - [optional] - City
* ''state'' - [optional] - State
* ''state'' - [optional] - State
* ''zip'' - [optional] - Zip code
* ''zip'' - [optional] - Zip code
* ''country'' - [optional] - ISO3166 Country code
* ''homephone'' - [optional] - Home phone number
* ''homephone'' - [optional] - Home phone number
* ''workphone'' - [optional] - Work phone number
* ''workphone'' - [optional] - Work phone number

Latest revision as of 16:43, 10 July 2017

The Caregiver subsystem allows you to create, view, edit and delete caregivers from a system via Internal GCAPI.

Operations

create

Create a caregiver

Parameters

  • firstname - [required] - First name
  • lastname - [required] - Last name
  • nickname - [optional] - Nick name
  • id - [optional] - Unique ID in UUID format
  • email - [optional] - Email address
  • address - [optional] - Street address
  • address2 - [optional] - Street address2
  • city - [optional] - City
  • state - [optional] - State / Region / Province
  • zip - [optional] - Zip code
  • country - [optional] - ISO3166 Country Code
  • homephone - [optional] - Home phone number
  • workphone - [optional] - Work phone number
  • cellphone - [optional] - Cell phone number
  • pager - [optional] - Pager phone number

Results

SUCCESS, returns back saved caregiver

xml

$ curl "http://10.100.1.2/api/caregiver.php?op=create&encoding=xml&passcode=x&firstname=Nicholas&lastname=Hall&address=123+Fake+St&state=WI&zipcode=53095&city=West+Bend"
<gcapi>
	<result>SUCCESS</result>
	<caregiver>
		<id>cbaaf355-9c16-4a24-858b-869f6bf303f9</id>
		<firstname>Nicholas</firstname>
		<lastname>Hall</lastname>
		<nickname> </nickname>
		<address>123 Fake St</address>
		<address2> </address2>
		<city>West Bend</city>
		<country> </country>
		<state>WI</state>
		<zipcode>53095</zipcode>
		<homephone> </homephone>
		<workphone> </workphone>
		<cellphone> </cellphone>
		<pager> </pager>
		<email> </email>
	</caregiver>
</gcapi>

json

$ curl "http://10.100.1.2/api/caregiver.php?op=create&encoding=json&passcode=x&firstname=Nicholas&lastname=Hall&address=123+Fake+St&state=WI&zipcode=53095&city=West+Bend"
{
   "gcapi": {
       "result": "SUCCESS",
       "caregiver": {
           "id": "93c2dc15-20b3-4884-81ca-6f57335a1bdb",
           "firstname": "Nicholas",
           "lastname": "Hall",
           "nickname": " ",
           "address": "123 Fake St",
           "address2": " ",
           "city": "West Bend",
           "state": "WI",
           "zipcode": "53095",
           "country": " ",
           "homephone": " ",
           "workphone": " ",
           "cellphone": " ",
           "pager": " ",
           "email": " "
       }
   }
}

read

Reads a single caregiver or all caregivers

Parameters

  • id - [optional] - ID of specific caregiver to read. If left blank, reads all caregivers

Results

Returns SUCCESS and a single caregiver or all caregivers in the following format:

xml

<gcapi>
	<result>SUCCESS</result>
	<caregiver>
		<id>5f3e081d-e6af-4dd6-a6b8-dd4d8890e611</id>
		<firstname>Shirley</firstname>
		<lastname>Doe</lastname>
		<address>2412 West Washington Ave</address>
		<city>West Bend</city>
		<state>WI</state>
		<zipcode>53095</zipcode>
		<homephone>2623349394</homephone>
		<workphone>2623386147</workphone>
		<cellphone>2626896732</cellphone>
		<pager></pager>
		<email>shirley@grandcare.com</email>
	</caregiver>
</gcapi>

json

{
   "gcapi": {
       "result": "SUCCESS",
       "caregiver": [
           {
               "id": "5f3e081d-e6af-4dd6-a6b8-dd4d8890e611",
               "firstname": "Shirley",
               "lastname": "Doe",
               "address": "2412 West Washington Ave",
               "city": "West Bend",
               "state": "WI",
               "zipcode": "53095",
               "homephone": "2623349394",
               "workphone": "2623386147",
               "cellphone": "2626896732",
               "pager": "",
               "email": "shirley@grandcare.com"
           }
       ]
   }
}

update

Updates an existing caregiver

Parameters

  • id - [required] - ID of caregiver to update
  • firstname - [optional] - First name
  • lastname - [optional] - Last name
  • nickname - [optional] - Nick name
  • email - [optional] - Email address
  • address - [optional] - Street address
  • address2 - [optional] - Street address2
  • city - [optional] - City
  • state - [optional] - State
  • zip - [optional] - Zip code
  • country - [optional] - ISO3166 Country code
  • homephone - [optional] - Home phone number
  • workphone - [optional] - Work phone number
  • cellphone - [optional] - Cell phone number
  • pager - [optional] - Pager phone number

Results

Returns SUCCESS and a copy of the newly updated caregiver if successful, otherwise FAILURE. See the #read method for more information on the returned caregiver object.

delete

Deletes an existing caregiver

Parameters

  • id - [required] - ID of caregiver to delete

Results

Returns SUCCESS if the caregiver is deleted, otherwise FAILURE.