A WordPress plugin that established API endpoints for managing rservations at a customer level.
Endpoint: /wp-json/experience/v1/login
fetch('https://makesantafe.org/wp-json/experience/v1/login', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
clientID: [clientID],//constant defined in app that matches API constant
email: [user_email],//email address that user used to signup with
password: [user_password],//password chosen by user
}),
})
{
"success": true,
"message": "Success!",
"user_key": "[key associated with the user]"
}
Endpoint: /wp-json/experience/v1/userprofile_update
fetch('https://makesantafe.org/wp-json/experience/v1/userprofile_update', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
clientID: [clientID],//constant defined in app that matches API constant
userKey: [userKey],//email address that user used to signup with
options: [
//TODO: Add options to update
]
}),
})
{
//TODO: Returns the options and updated values
}
Endpoint: /wp-json/experience/v1/userprofile
fetch('https://makesantafe.org/wp-json/experience/v1/userprofile', {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
clientID: [clientID],//constant defined in app that matches API constant
userKey: [userKey], //userKey returned during the login or account creation process
}),
})
{
"userID": "4",
"success": true,
"name": "[email protected]",
"user_meta": {
//TODO: Update DOCS with proper return
},
"options": {
//TODO: Update DOCS with proper return
},
}