Additional documentaion for the backend can be found here: https://github.com/random-kindness-generator/randomActs-BE/tree/DevEB#frontend
- Authentication: All endpoints except api/register and api/login require a valid token to be passed in the request header.
registerInfo ={
"username": "string", <-required
"password": "string", <-required
"name": "string",
"phone": "string",
"email": "string",
"address": "string"
}
${URL}/api/register, {
registerInfo }
loginInfo ={
"username": "string",
"password": "string"
}
${URL}/api/login, {
loginInfo }
userInfo = {
"username": "string",
"password": "string",
"name": "string",
"phone": "string",
"email": "string",
"address": "string"
}
${URL}/api/users, {
userInfo} { headers: {Authorization:
token} }
${URL}/api/users, { headers: {Authorization:
token} }
${URL}/api/users/${
UserId}, { headers: {Authorization:
token} }
${URL}/api/users/${
UserId}/contacts, { headers: {Authorization:
token} }
updatedInfo = {
"username": "string",
"password": "string",
"name": "string",
"phone": "string",
"email": "string",
"address": "string"
}
${URL}/api/users/${UserId}, {
updatedInfo}, { headers: {Authorization:
token} }
${URL}/api/users/${UserId}, { headers: {Authorization:
token} }
contactInfo ={
"name": "admin2",
"phone": "1234567890",
"email": "[email protected]",
"address": "123 street",
"group": "friends",
"notes": "likes beach stuff",
"user_id": 1
}
${URL}/api/contacts, {
contactInfo}, { headers: {Authorization:
token} }
${URL}/api/contacts, { headers: {
Authorization: token} }
${URL}/api/contacts/${
id}, { headers: {Authorization:
token} }
updatedInfo = {
"name": "admin2",
"phone": "1234567890",
"email": "[email protected]",
"address": "123 street",
"group": "friends",
"notes": "likes beach stuff",
"user_id": 1
}
${URL}/api/contacts/${
id}, {
updatedInfo}, { headers: {Authorization:
token} }
${URL}/api/contacts/${
id}, { headers: {Authorization:
token} }
actionInfo ={
"name": "admin2",
"phone": "1234567890",
"email": "[email protected]",
"address": "123 street",
"group": "friends",
"notes": "likes beach stuff",
"user_id": 1
}
${URL}/api/actions, {
actionInfo}, { headers: {Authorization:
token} }
${URL}/api/actions, { headers: {
Authorization: token} }
${URL}/api/actions/${
id}, { headers: {Authorization:
token} }
updatedInfo = {
"name": "admin2",
"phone": "1234567890",
"email": "[email protected]",
"address": "123 street",
"group": "friends",
"notes": "likes beach stuff",
"user_id": 1
}
${URL}/api/actions/${
id}, {
updatedInfo}, { headers: {Authorization:
token} }
${URL}/api/actions/${
id}, { headers: {Authorization:
token} }