Back end for Voicer
POST /api/attribute
Name | Type | Description |
---|---|---|
voice_sample_id | Integer |
ID of the voice sample to attach attribute to |
title | String |
Name of the attribute |
Name | Type | Description |
---|---|---|
id | Integer |
ID of many:many association |
HTTP 201 Created
{
123
}
DELETE /api/attribute/:id
Name | Type | Description |
---|---|---|
id | Integer |
ID of the attribute to be deleted |
Name | Type | Description |
---|---|---|
number | Integer |
Number rows deleted |
PUT /api/attribute/:id
Name | Type | Description |
---|---|---|
id | Integer |
ID of the attribute to be edited |
data | json |
Data of the attribute to be edited |
GET /api/attribute
Name | Type | Description |
---|---|---|
attribute | json |
Attribute |
HTTP 200 ok
{
"id": 1,
"title": "Attribute Title"
}
POST /api/login
Name | Type | Description |
---|---|---|
String |
Email field for login |
|
password | String |
Password field for login |
Name | Type | Description |
---|---|---|
token | Logging in returns a token |
HTTP 200 OK
{
"token": "encrypted jwt"
}
POST /api/register
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 |
String |
Email field for User |
|
password | String |
Password field for User |
Name | Type | Description |
---|---|---|
token | Registers user and returns token |
HTTP 201 OK
{
"token": "encrypted jwt"
}
GET /api/users
Name | Type | Description |
---|---|---|
User |
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": []
}
]
}
]
GET /api/users?tag=tag1,tag2...
Name | Type | Description |
---|---|---|
tags | param |
Input a list of tags separated by commas |
Name | Type | Description |
---|---|---|
User |
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",
"..."
]
}
]
}
GET /api/users?display_name=displayName
Name | Type | Description |
---|---|---|
display_name | param |
Input display name |
Name | Type | Description |
---|---|---|
User |
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": []
}
]
}
GET /api/users/:id
Name | Type | Description |
---|---|---|
id | param |
User id for retrieving specified user |
Name | Type | Description |
---|---|---|
User |
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": []
}
]
}
PUT /api/users/:id
Name | Type | Description |
---|---|---|
id | param |
User id for locating the user to update |
data | object |
User data to be updated |
Name | Type | Description |
---|---|---|
User |
GET /api/voice/sample
Name | Type | Description |
---|---|---|
sample | json |
Voice Sample |
HTTP 200 OK
{
"id": 1,
"owner": 1,
"title": "Title",
"description": "Description",
"rating": 2.3,
"s3_location": "aws_s3 url",
"tags": [
"tag1",
"tag2",
"..."
]
}
GET /api/voice/sample/:id
Name | Type | Description |
---|---|---|
id | Integer |
ID of voice sample |
Name | Type | Description |
---|---|---|
sample | json |
Voice Sample |
HTTP 200 OK
{
"id": 1,
"owner": 1,
"title": "Title",
"description": "Description",
"rating": 2.3,
"s3_location": "aws_s3 url",
"tags": [
"tag1",
"tag2",
"..."
]
}
GET /api/voice/:id
Name | Type | Description |
---|---|---|
id | Integer |
ID of user |
Name | Type | Description |
---|---|---|
samples | json |
Voice Samples |
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",
"..."
]
}
]