CarePenguin Customer Web Portal New Calls
Endpoint for a user to hit when they deactivate their own account from the CWP
Method: DELETE
Path: /user/:user_id/delete (Nick has set this up, check swagger)
Content-Type: application/json
Body: {}
{
result: { errors: [ 'Failed to deactivate account' ] }
}
Create-user/sign-up endpoint for use on CWP Create User form submission (including validation of emailed magic link)
Method: POST
Path: /user/create
Content-Type: application/json
Body: JSON.stringify({
name: 'Noah Gambee',
email: '[email protected] ',
phone: '3035557866',
password: 'ilovepizza789'
}),
{
result: { data: { userId: 123 }}
}
{
result: { errors: [ 'Email already in use by another account' ] }
}
Validate new user through emailed link
Method: POST
Path: /user/create/validate
Content-Type: application/json
Body: JSON.stringify({
magicLinkId: 'FH367NEYX4H',
userId: 49
}),
{
result: { data: { userId: 123 }}
}
{
result: { errors: [ 'Validation failed', '{reason for failure}' ] }
}
Endpoint for user to edit their own account details ie: email/phone/name (Nick has already done this one)
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"
}
]
}
{
result: { errors: [ 'email already in use by another account' ] }
}