Create
/api/v2/access/create
Post
profiles
jwt
Purpose
To allow a user to create an Access Group.
Body Content [input]
{
uid: string,
name: string,
members: string[]
}
Returns if valid [output]
{
accessID: string,
error: 0
}
What the API does
- Loops through each of the
member
in the passedmembers
field and ensures that there’s a record for thatuser
in theprofiles
collection [404]. - Generates a unique
accessID
. - Finds the
profile
of the record corresponding to theuid
passed from theprofiles
collection and creates and saves a new object inside of theaccess_groups
field using theuid
,name
andmembers
fields passed, as well as the generatedaccessID
.