Skip to content

alphaseinor/voicer-be

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voicer Backend

Badges

Maintainability Test Coverage

Back end for Voicer


Attributes

Add an attribute to a voice sample

Back to top

POST /api/attribute

Parameters - Parameter

Name Type Description
voice_sample_id Integer

ID of the voice sample to attach attribute to

title String

Name of the attribute

Success response

Success response - Success 200

Name Type Description
id Integer

ID of many:many association

Success response example

Success response example - Success-Response:

HTTP 201 Created
{
  123
}

Delete an attribute

Back to top

DELETE /api/attribute/:id

Parameters - Parameter

Name Type Description
id Integer

ID of the attribute to be deleted

Success response

Success response - Success 200

Name Type Description
number Integer

Number rows deleted

Edit the properties of an attribute

Back to top

PUT /api/attribute/:id

Parameters - Parameter

Name Type Description
id Integer

ID of the attribute to be edited

data json

Data of the attribute to be edited

Retrieve all available attributes

Back to top

GET /api/attribute

Success response

Success response - Success 200

Name Type Description
attribute json

Attribute

Success response example

Success response example - Success-Response:

HTTP 200 ok
{
  "id": 1,
  "title": "Attribute Title"
}

Users

Log in to the application

Back to top

POST /api/login

Parameters - Parameter

Name Type Description
email String

Email field for login

password String

Password field for login

Success response

Success response - Success 200

Name Type Description
token

Logging in returns a token

Success response example

Success response example - Success-Response:

HTTP 200 OK
{
  "token": "encrypted jwt"
}

Register a user

Back to top

POST /api/register

Parameters - Parameter

Name Type Description
first_name String

First Name field for User

last_name String

Last Name field for User

display_name String

Display Name field for User

email String

Email field for User

password String

Password field for User

Success response

Success response - Success 200

Name Type Description
token

Registers user and returns token

Success response example

Success response example - Success-Response:

HTTP 201 OK
{
  "token": "encrypted jwt"
}

Retrieve a list of all users

Back to top

GET /api/users

Success response

Success response - Success 200

Name Type Description
User

Success response example

Success response example - Success-Response:

 HTTP 200 OK
 [
   {
     "id": 1,
     "email": "some@email.com",
     "first_name": "First Name",
     "last_name": "Last Name",
     "display_name": "Display Name",
     "payrate": 15.25,
     "location": "The Internet",
     "jobsCompleted": 2,
     "bio": "Bio",
     "average_rating": 2.3,
     "account_balance": 538.23,
     "samples": [
       {
         "id": 1,
         "owner": 1,
         "title": "Title",
         "description": "Description",
         "rating": 2.3,
         "s3_location": "aws_s3 url",
         "tags": []
       }
     ]
   },
   {
     "id": 2,
     "email": "some@email.com",
     "first_name": "First Name",
     "last_name": "Last Name",
     "display_name": "Display Name",
     "payrate": 15.25,
     "location": "The Internet",
     "jobsCompleted": 2,
     "bio": "Bio",
     "average_rating": 2.3,
     "account_balance": 538.23,
     "samples": [
       {
         "id": 1,
         "owner": 1,
         "title": "Title",
         "description": "Description",
         "rating": 2.3,
         "s3_location": "aws_s3 url",
         "tags": []
       }
     ]
   }
]

Retrieve a list of users by sample tags

Back to top

GET /api/users?tag=tag1,tag2...

Parameters - Parameter

Name Type Description
tags param

Input a list of tags separated by commas

Success response

Success response - Success 200

Name Type Description
User

Success response example

Success response example - Success-Response:

HTTP 200 OK
{
  "id": 1,
  "email": "some@email.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "display_name": "Display Name",
  "payrate": 15.25,
  "location": "The Internet",
  "jobsCompleted": 2,
  "bio": "Bio",
  "average_rating": 2.3,
  "account_balance": 538.23,
  "samples": [
    {
      "id": 1,
      "owner": 1,
      "title": "Title",
      "description": "Description",
      "rating": 2.3,
      "s3_location": "aws_s3 url",
      "tags": [
        "tag1",
        "tag2",
        "..."
      ]
    }
  ]
}

Retrieve a user by display name

Back to top

GET /api/users?display_name=displayName

Parameters - Parameter

Name Type Description
display_name param

Input display name

Success response

Success response - Success 200

Name Type Description
User

Success response example

Success response example - Success-Response:

HTTP 200 OK
{
  "id": 1,
  "email": "some@email.com",
  "first_name": "First Name",
  "last_name": "Last Name",
  "display_name": "Display Name",
  "payrate": 15.25,
  "location": "The Internet",
  "jobsCompleted": 2,
  "bio": "Bio",
  "average_rating": 2.3,
  "account_balance": 538.23,
  "samples": [
    {
      "id": 1,
      "owner": 1,
      "title": "Title",
      "description": "Description",
      "rating": 2.3,
      "s3_location": "aws_s3 url",
      "tags": []
    }
  ]
}

Retrieve a user by id

Back to top

GET /api/users/:id

Parameters - Parameter

Name Type Description
id param

User id for retrieving specified user

Success response

Success response - Success 200

Name Type Description
User

Success response example

Success response example - Success-Response:

 HTTP 200 OK
 {
   "id": 1,
   "email": "some@email.com",
   "first_name": "First Name",
   "last_name": "Last Name",
   "display_name": "Display Name",
   "payrate": 15.25,
   "location": "The Internet",
   "jobsCompleted": 2,
   "bio": "Bio",
   "average_rating": 2.3,
   "account_balance": 538.23,
   "samples": [
     {
       "id": 1,
       "owner": 1,
       "title": "Title",
       "description": "Description",
       "rating": 2.3,
       "s3_location": "aws_s3 url",
       "tags": []
     }
   ]
}

Update a user with specified id

Back to top

PUT /api/users/:id

Parameters - Parameter

Name Type Description
id param

User id for locating the user to update

data object

User data to be updated

Success response

Success response - Success 200

Name Type Description
User

VoiceSamples

Get all voice samples

Back to top

GET /api/voice/sample

Success response

Success response - Success 200

Name Type Description
sample json

Voice Sample

Success response example

Success response example - Success-Response:

HTTP 200 OK
{
   "id": 1,
   "owner": 1,
   "title": "Title",
   "description": "Description",
   "rating": 2.3,
   "s3_location": "aws_s3 url",
   "tags": [
     "tag1",
     "tag2",
     "..."
   ]
}

Get voice sample by id

Back to top

GET /api/voice/sample/:id

Parameters - Parameter

Name Type Description
id Integer

ID of voice sample

Success response

Success response - Success 200

Name Type Description
sample json

Voice Sample

Success response example

Success response example - Success-Response:

 HTTP 200 OK
{
   "id": 1,
   "owner": 1,
   "title": "Title",
   "description": "Description",
   "rating": 2.3,
   "s3_location": "aws_s3 url",
   "tags": [
     "tag1",
     "tag2",
     "..."
   ]
}

Get voice samples by user id

Back to top

GET /api/voice/:id

Parameters - Parameter

Name Type Description
id Integer

ID of user

Success response

Success response - Success 200

Name Type Description
samples json

Voice Samples

Success response example

Success response example - Success-Response:

HTTP 200 OK
[
  {
     "id": 1,
     "owner": 1,
     "title": "Title",
     "description": "Description",
     "rating": 2.3,
     "s3_location": "aws_s3 url",
     "tags": [
       "tag1",
       "tag2",
       "..."
     ]
  }
  {
     "id": 2,
     "owner": 1,
     "title": "Title",
     "description": "Description",
     "rating": 2.3,
     "s3_location": "aws_s3 url",
     "tags": [
       "tag1",
       "tag2",
       "..."
     ]
  }
]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%