Historic Artists - Hip-Hop-Xpress/hhx-api GitHub Wiki

Historic artists endpoint

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.

Guide

The Historic artist object

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",
}

Attributes

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 Objects 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

The Image object

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"
}

Attributes

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

Endpoints

Overview

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

Usage

All use cases for the Historic artists endpoints are listed below.

Collection wide:

Historic artist specific:

Historic artist data specific:

View the error documentation for what to expect if your request fails.


Create historic artist

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.

Parameters

A valid historic artist object (JSON) with correct attributes

Returns

The historic artist object as added in the database if successful


Retrieve all historic artists

GET /v1/historic

Retrieves the data for all historic artists

Parameters

None

Returns

An array of all historic artist objects


Retrieve historic artist

GET /v1/historic/:id

Retrieves a specific historic artist through its id

Parameters

None

Returns

The historic artist object with specified id


Update historic artist

PUT /v1/historic/:id

Updates attributes of a specified historic artist object by id

Parameters

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.

Returns

The updated historic artist object


Delete historic artist

DELETE /v1/historic/:id

Deles a historic artist object with id

Parameters

None

Returns

The historic artist object that was deleted


Add images

POST /v1/historic/:id/images

Adds images to a specific historic artist by including the image objects in your request body.

Parameters

Either a single image object or an array of image objects in the request body. All attributes are required for each image object.

Returns

The updated images array


Retrieve images

GET /v1/historic/:id/images

Retrieves all the images for a specified historic artist by id

Parameters

None

Returns

The images array of historic artist with specified id


Add to bio

POST /v1/historic/:id/bio

Adds text to a historic artist's bio by by including the text in the request body

Parameters

Either a single string or an array of strings in the request body

Returns

The updated bio (array of strings)t


Retrieve bio

GET /v1/historic/:id/bio

Retrieves all the text in a specific historic artist's bio

Parameters

None

Returns

The description (array of strings)

Create social platform

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.

Parameters

A valid social media object (JSON) with correct attributes

Returns

The social media object as added in the database


Retrieve all socials

GET /v1/historic/:id/socials

Retrieves the data for all of the historic artist's socials

Parameters

None

Returns

An array of all social media objects

Back to top

⚠️ **GitHub.com Fallback** ⚠️