Featured Artists - Hip-Hop-Xpress/hhx-api GitHub Wiki
The Hip Hop Xpress aims to feature talented artists in the Champaign-Urbana area. This endpoint serves as a way to gather information about these talented artists.
- The Featured artist object
- The Featured artist 'Image' object
- The Featured artist 'Social media' object
- Endpoints
Each featured 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": "BUD LASER",
"current": true,
"date": "Summer 2020",
"bio": [
"Composer/Producer/DJ/Sound Design & Engineer from Champaign, IL, BUD LASER is..."
],
"headerImageUrl": "https://www.publish.illinois.edu/.../BudLaserLogo.jpg",
"images": [
{
"url": "https://www.publish.illinois.edu/.../BudLaserProfile.jpg",
"caption": "Bud Laser in the Studio"
}
],
"socials": [
{
"type": "instagram",
"handle": "@budlaser",
"url": "https://www.instagram.com/budlaser/"
}
]
}
Name | Type | Restrictions | Description |
---|---|---|---|
id |
number |
must be unique non-zero integer, cannot be updated once created | unique identifier for featured artist |
name |
string |
must be non-empty | display name for featured artist |
current |
boolean |
only one featured artist will have current set to true |
whether this artist is the currently featured artist |
date |
string |
must be 4 characters or more | describes the time period that the artist was featured |
bio |
Array of string
|
must be non-empty | describes the featured artist |
headerImageUrl |
string |
must be a valid url | the main image of the artist, to be displayed as a header or other prominent feature |
images |
Array of image Object s |
can be empty, contents must follow the image schema | all images to be displayed for this artist |
socials |
Array of Social media Object s |
must be non-empty, contents must follow the social media object schema, no duplicates | lists all social media platforms for featured artist |
Image object schema for images
array in the featured 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 featured artist |
caption |
string |
none, can be empty | briefly describes the image |
Social media schema for socials
array in the featured artist object. Each field is required when adding social media platforms. You cannot have more than one social media object with the same type
.
{
"type": "instagram",
"handle": "@budlaser",
"url": "https://www.instagram.com/budlaser/"
}
Name | Type | Restrictions | Description |
---|---|---|---|
type |
string |
must be a social media type as listed here, cannot be updated once created, cannot have duplicates | the specific social media platform, also specifies which platform to render on buttons and other components |
handle |
string |
must be nonempty | the social media handle/username |
url |
string |
must be a valid url | the social media URL |
A quick overview of all endpoints related to Featured artists on the Hip Hop Xpress
// Collection wide endpoints
POST /v1/featured
GET /v1/featured
// Artist specific endpoints
GET /v1/featured/:id
PUT /v1/featured/:id
DELETE /v1/featured/:id
// Bio specific endpoints
POST /v1/featured/:id/bio
GET /v1/featured/:id/bio
// Image specific endpoints
POST /v1/featured/:id/images
GET /v1/featured/:id/images
// Social media specific endpoints
POST /v1/featured/:id/socials
GET /v1/featured/:id/socials
All use cases for the Featured artists endpoints are listed below.
Collection wide:
Featured artist specific:
- Retrieve a featured artist:
GET /v1/featured/:id
- Update a featured artist:
PUT /v1/featured/:id
- Delete a featured artist:
DELETE /v1/featured/:id
Featured artist data specific:
- Add text to featured artist bio:
POST /v1/featured/:id/bio
- Retrieve featured artist's bio:
GET /v1/featured/:id/bio
- Add images for featured artist:
POST /v1/featured/:id/images
- Retrieve images for featured artist:
GET /v1/featured/:id/images
- Create social media:
POST /v1/featured/:id/socials
- Retrieve all socials:
GET /v1/featured/:id/socials
View the error documentation for what to expect if your request fails.
POST /v1/featured
Creates a featured artist by including a featured artist object (JSON) in the request body. All fields are required, and the id
must be a unique, non-negative integer.
A valid featured artist object (JSON) with correct attributes
The featured artist object as added in the database if successful
GET /v1/featured
Retrieves the data for all featured artists
None
An array of all featured artist objects
GET /v1/featured/:id
Retrieves a specific featured artist through its id
None
The featured artist object with specified id
PUT /v1/featured/:id
Updates attributes of a specified featured artist object by id
A featured 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 featured artist object
DELETE /v1/featured/:id
Deles a featured artist object with id
None
The featured artist object that was deleted
POST /v1/featured/:id/images
Adds images to a specific featured 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/featured/:id/images
Retrieves all the images for a specified featured artist by id
None
The images array of featured artist with specified id
POST /v1/featured/:id/bio
Adds text to a featured 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/featured/:id/bio
Retrieves all the text in a specific featured artist's bio
None
The description (array of string
s)
POST /v1/featured/: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/featured/:id/socials
Retrieves the data for all of the featured artist's socials
None
An array of all social media objects