CarePenguin Support Web Portal New Calls
Endpoint for an admin to hit when they deactivate an account from the SWP
Method: DELETE
Path: /user/:user_id/delete (Nick has set this up for users to deactivate themselves already)
Content-Type: application/json
Body: {}
{
data: { userID: 456, name: 'Noah', deactivated: true }
}
Endpoint for an admin to hit when they archive a sensor from the SWP
Method: DELETE
Path: /sensor/:sensor_id/delete
Content-Type: application/json
Body: {}
{
data: { sensorID: 54545, name: 'Grandpa's sensor', archived: true }
}
Endpoint for an admin to search for a user (via phone, name, or email)
Method: POST
Path: /users/search
Content-Type: application/json
Body: JSON.stringify({
queryString: 'gambee',
}),
{
data: [{ name: 'Noah Gambee', phone: '5555555555', email: '[email protected] ', userID: 123 }, { name: 'Tony Gambee', phone: '4555555555', email: '[email protected] ', userID: 321}]
}
{
data: []
}
Endpoint for an admin to edit account/sensor/location details ie: email/phone/name sensor_name/location_name
Method: PATCH
Path: /user/:id
Content-Type: application/json-patch+json
Body: {
"patches" : [
{
"op" : "replace",
"path" : "/email",
"value" : "[email protected] "
},
{
"op" : "replace",
"path" : "/phone",
"value" : "3035558739"
}
]
}
Method: PATCH
Path: /location/:location_id
Content-Type: application/json-patch+json
Body: {
"patches" : [
{
"op" : "replace",
"path" : "/name",
"value" : "Grandpa Joe's House"
},
]
}
Method: PATCH
Path: /sensor/:sensor_id
Content-Type: application/json-patch+json
Body: {
"patches" : [
{
"op" : "replace",
"path" : "/name",
"value" : "Grandpa's Water Heater"
},
]
}
Endpoint for admin to fetch sensor/graph data (assuming we aren't using the non-admin endpoint that already does this)
Method: GET
Path: /location/:location_id/data?=useCumulativeEvents=false&downsample=5.minute
Content-Type: application/json
{
data: {sensors: [{ name: 'Grandpa's water heater', id: 53863, sensorData: [...] }]}
}
Endpoint for admin to login as
a user into the CWP
Method: POST
Path: /user/:user_id/login
Content-Type: application/json
{
data: {userID: 123, name: 'Noah Gambee', phone: '555555555', email: '[email protected] '}
}
{
errors: ['Unable to locate user with ID: 123']
}