Historic Artists - Hip-Hop-Xpress/hhx-api GitHub Wiki
Throughout history, several great artists have paved the way for hip hop in the music industry and into our very lives. These artists are honored through artwork on the Double Dutch Boom Bus, and this endpoint serves to provide information about these incredible, timeless artists and musicians.
Each historic artist object holds data in JSON format. All attributes are required in POST requests, but not in PUT requests (see more here).
{
"id": 0,
"name": "Michael Jackson",
"born": "August 29, 1958",
"died": "June 25, 2009",
"description": [
"Michael Jackson’s career started from his family music group, the Jackson 5, which..."
],
"images": [
{
"url": "https://www.publish.illinois.edu/.../MichaelJacksonProfile.jpg",
"caption": "Jackson performing"
}
],
"spotify": "https://open.spotify.com/artist/3fMbdgg4jU18AjLCKBhRSm",
}
Name | Type | Restrictions | Description |
---|---|---|---|
id |
number |
must be unique non-zero integer, cannot be updated once created | unique identifier for historic artist |
name |
string |
must be non-empty | display name for historic artist |
born |
string |
must be 4 characters or more | describes the date the artist was born |
died |
string or null
|
must be 4 characters or more | describes the date the artist died, or null if the artist is still alive |
description |
Array of string
|
must be non-empty | describes the historic artist |
images |
Array of image Object s |
can be empty, contents must follow the image schema | all images to be displayed for this artist |
spotify |
string |
can be null/undefined, otherwise must be URL | the Spotify URL for the artist |
Image object schema for images
array in the historic artist object. Each field is required when creating new images.
{
"url": "https://www.publish.illinois.edu/.../BudLaserProfile.jpg",
"caption": "Bud Laser in the Studio"
}
Name | Type | Restrictions | Description |
---|---|---|---|
url |
string |
must be a valid URL | points to image of historic artist |
caption |
string |
none, can be empty | briefly describes the image |
A quick overview of all endpoints related to Historic artists on the Hip Hop Xpress
POST /v1/historic
GET /v1/historic
GET /v1/historic/:id
PUT /v1/historic/:id
DELETE /v1/historic/:id
POST /v1/historic/:id/bio
GET /v1/historic/:id/bio
POST /v1/historic/:id/images
GET /v1/historic/:id/images
All use cases for the Historic artists endpoints are listed below.
Collection wide:
Historic artist specific:
- Retrieve a historic artist:
GET /v1/historic/:id
- Update a historic artist:
PUT /v1/historic/:id
- Delete a historic artist:
DELETE /v1/historic/:id
Historic artist data specific:
- Add text to historic artist bio:
POST /v1/historic/:id/bio
- Retrieve historic artist's bio:
GET /v1/historic/:id/bio
- Add images for historic artist:
POST /v1/historic/:id/images
- Retrieve images for historic artist:
GET /v1/historic/:id/images
View the error documentation for what to expect if your request fails.
POST /v1/historic
Creates a historic artist by including a historic artist object (JSON) in the request body. All fields are required, and the id
must be a unique, non-negative integer.
A valid historic artist object (JSON) with correct attributes
The historic artist object as added in the database if successful
GET /v1/historic
Retrieves the data for all historic artists
None
An array of all historic artist objects
GET /v1/historic/:id
Retrieves a specific historic artist through its id
None
The historic artist object with specified id
PUT /v1/historic/:id
Updates attributes of a specified historic artist object by id
A historic artist object containing only the attributes needing change, and their updated values. For example, if you need to change the date
attribute, you only need to include the date
field in your request: {"date": "some new date"}
. However, any updated attributes must follow the attribute restrictions.
The updated historic artist object
DELETE /v1/historic/:id
Deles a historic artist object with id
None
The historic artist object that was deleted
POST /v1/historic/:id/images
Adds images to a specific historic artist by including the image objects in your request body.
Either a single image object or an array of image objects in the request body. All attributes are required for each image object.
The updated images array
GET /v1/historic/:id/images
Retrieves all the images for a specified historic artist by id
None
The images array of historic artist with specified id
POST /v1/historic/:id/bio
Adds text to a historic artist's bio by by including the text in the request body
Either a single string
or an array of string
s in the request body
The updated bio (array of string
s)t
GET /v1/historic/:id/bio
Retrieves all the text in a specific historic artist's bio
None
The description (array of string
s)
POST /v1/historic/:id/socials
Creates an social media object for the artist by including a social media object (JSON) in the request body - all attributes are required.
A valid social media object (JSON) with correct attributes
The social media object as added in the database
GET /v1/historic/:id/socials
Retrieves the data for all of the historic artist's socials
None
An array of all social media objects