Social Media - Hip-Hop-Xpress/hhx-api GitHub Wiki
The Hip Hop Xpress uses social media platforms to extend its outreach, and this API endpoint serves as a way for app clients to retrieve our social media information dynamically.
{
"type": "instagram",
"handle": "@uiuchhx",
"url": "https://www.instagram.com/uiuchhx/"
}
These attributes are to be included in POST
and PUT
request bodies.
Name | Type | Restrictions | Description |
---|---|---|---|
type |
string |
must be a social media type as listed here, cannot be updated once created | 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 our social media:
POST /v1/socials
GET /v1/socials
GET /v1/socials/types
GET /v1/socials/:type
PUT /v1/socials/:type
DELETE /v1/socials/:type
All use cases for the social media endpoints are listed below.
Collection wide:
- Create social media:
POST /v1/socials
- Retrieve all socials:
GET /v1/socials
- Retrieve all social media types:
GET /v1/socials/types
Update specific:
- Retrieve a social platform:
GET /v1/socials/:type
- Update a social platform:
PUT /v1/socials/:type
- Delete a social platform:
DELETE /v1/socials/:type
View the error documentation for what to expect if your request fails.
POST /v1/socials
Creates an social media platform 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/socials
Retrieves the data for all socials
None
An array of all social media objects
GET /v1/socials/types
Retrieves all social media types
An array of string
s containing all social media types
GET /v1/socials/:type
Retrieves a specific social media platform through its type
None
The update object with specified type
PUT /v1/socials/:type
Update specific attributes of an social media object with type
An object containing only the attributes needing change, and their updated values. For example, if you need to change the handle
attribute, you only need to include the handle
field in your request: {"handle": "@the_new_uiuchhx"}
. However, any updated attributes must follow the attribute restrictions.
The updated social media object
DELETE /v1/socials/:type
Deletes a specific social platform from the database by its type
None
The social media object that was deleted