Useful information to help developers understand and use our backend API
Get all/every registry
Route is protected for: no one
Success: An array of registry objects with their items array populated
Failed: { message: 'A detailed error message here' }
No body needed
Get the registry of the current logged in user
Route is protected for: registry owner or admin
Success: A registry object
Failed: { message: 'A detailed error message here' }
No body needed
Create a single registry
Route is protected for: paid users
Success: An array of registry objects with their items array populated
Failed: { message: 'A detailed error message here' }
body = {
title: String,
description: String,
p1FullName: String,
p2FullName: String,
email: String,
customUrl: String, // no spaces
items: [ String ],
coverImage: String,
userId: String,
tyMessage: String, // optional
weddingDate: Date.now(), // optional
phoneNumber: Number, // optional
}
Get a single registry by it's customUrl
Route is protected for: no one
Success: A registry object with its items array populated
Failed: { message: 'A detailed error message here' }
No body needed
Update a single registry
Route is protected for: registry owners or admins
Success: An array of registry objects with their items array populated
Failed: { message: 'A detailed error message here' }
body = {
title: String, // optional
description: String, // optional
p1FullName: String, // optional
p2FullName: String, // optional
email: String, // optional
customUrl: String, // optional
coverImage: String, // optional
tyMessage: String, // optional
weddingDate: Date.now(), // optional
phoneNumber: Number, // optional
}
Delete a single registry and all it's items
Route is protected for: registry owners or admins
Success: { message: 'Deleted registry and num/num items }
Failed: { message: 'A detailed error message here' }
No body needed
Get all/every item
Route is protected for: no one
Success: An array of item objects
Failed: { message: 'A detailed error message here' }
No body needed
Get all item's for the Registry
Route is protected for: registry owners or admins
Success: An array of item objects
Failed: { message: 'A detailed error message here' }
No body needed
Get a single item by it's id
Route is protected for: no one
Success: An items object
Failed: { message: 'A detailed error message here' }
No body needed
Update item on purchase and save purchaser's info
Route is protected for: no one
Success: An updated item object
Failed: { message: 'A detailed error message here' }
body = {
name: String, // optional
email: String, // optional
message: String, // optional
pricePaid: Number,
}
Update one item's details
Route is protected for: registry owners or admins
Success: An updated item object
Failed: { message: 'A detailed error message here' }
body = {
name: String, // optional
description: String, // optional
price: Number, // optional
link: String, // optional
image: String, // optional
isReserved: String, // optional
reservedOn: Date.now(), // optional
}
Delete one item and remove it from that registry items array
Route is protected for: registry owners or admins
Success: The deleted item object
Failed: { message: 'A detailed error message here' }
No body needed
Create one item and add it to it's registry items array
Route is protected for: paid users
Success: The new item object
Failed: { message: 'A detailed error message here' }
body = {
name: String,
description: String,
price: Number,
link: String, // optional
image: String, // optional
}
Delete multiple items and remove them from that registry items array
Route is protected for: registry owners or admins
Success: { message: 'Updated registry items and deleted num/num items' }
Failed: { message: 'A detailed error message here' }
body = {
arrayOfIds: [ String ]
}