Link Search Menu Expand Document

Add

/api/v2/verified/add

Post

verifieds

users

notifications


Purpose

To allow the admin to add a user as verified.

Body Content [input]

{
    secret: string,
    membersID: string[]
}

Returns if valid [output]

{
    message: string,
    error: 0
}

What the API does

  • Checks if the value of the secret field passed is valid [401].
  • Checks that membersID is not empty [400] and loops through each of its values to ensure that there is a correponding record in the profiles collection with these values [404].
  • Adds a new record in the verifieds collection with a uid field corresponding to the value of the items in the membersID field passed.
  • Loops through each value present in the membersID field passed and generates a new notificationID and a timestamp corresponding to the current date and time, and creates a new object in the notifications collection with the following data :
    {
      uid: loop_value,
      notificationID: notificationID,
      content: `Your account has been verified! 😃`,
      profileID: '_system',
      type: "verified",
      created_on: timestamp,
      read: false,
      redirect: `/profile/`
    }