API Documentation: Friend Sites
Whether you have a portfolio site or just a website you want to show, this is how you add it to my site. Firstly please make sure you grab an API key from here. I hope to add more endpoints in the future, as well as making the documentation better, so come back often.
Endpoint:
URL: https://redframestudios.dev/API/FriendSites/UpdateSite
Method: POST
Description:
Lets you update your site with your API key. For any of the parameters, if you do not want to update it, simply leave it out of the request. If you wish to remove a can remove parameter from my site, set it to an empty string, or for the image, set it to null.
Parameters:
APIKey
The API key you received in your email.
- Type: string
- Is Required In Request: true
- Removable: false
firstName
Your first name.
- Type: string
- Is Required In Request: false
- Removable: false
- Limits: Max length of 50 characters.
lastName
Your last name.
- Type: string
- Is Required In Request: false
- Removable: false
- Limits: Max length of 50 characters.
email
Your email address.
- Type: string
- Is Required In Request: false
- Removable: true
- Limits: Max length of 100 characters.
message
A message about your site. Is required for your site to be visible.
- Type: string
- Is Required In Request: false
- Removable: false
- Limits: Max length of 500 characters.
urlText
The text that will be displayed for your URL. Is required for your site to be visible.
- Type: string
- Is Required In Request: false
- Removable: false
- Limits: Max length of 100 characters.
url
The URL of your site. Is required for your site to be visible.
- Type: string
- Is Required In Request: false
- Removable: true
-
Limits:
Max length of 200 characters, must be a valid URL format
(https://redframestudios.dev).
image
An image file to represent your site.
- Type: *file*
- Is Required In Request: false
- Removable: true
-
Limits:
Must be a valid image file
(jpg, png, jpeg), max size of 2MB, images are saved as jpegs so transparency is not supported.
Responses:
Success: Your site was successfully updated :D.
Site updated successfully. (Status 200)
Error: There was an error updating your site. This could be due to an invalid API key, missing required parameters, or other issues. It should tell you what it wants.
Site not found with the provided API key. (Status 401)
Examples:
Python Example:
Updating your site, note not all params are needed.
# Edit Example
import requests
# base url
url = "https://redframestudios.dev/API/FriendSites/UpdateSite"
# API key received in your email
key = "YOUR_API_KEY"
# open the image and grab its bytes
image = open("test.jpeg", "rb")
# json
payload = {
"APIKey": key,
"message": "This is a test message from the API.",
"urlText": "Check it out! NOW!",
"firstName": "Johns",
"lastName": "Doe",
"url": "https://redframestudios.dev",
}
# used for image
files = {"image": image}
response = requests.post(url, data=payload, files=files)
print(response.status_code)
print(response.text)
Python Example:
Removing data from the server, note removing your url (or any of the others that say they are required) will effectively remove your site from the page.
# Remove Example
import requests
# base url
url = "https://redframestudios.dev/API/FriendSites/UpdateSite"
# API key received in your email
key = "YOUR_API_KEY"
# set it to "None" to remove image from server
image = None
# json
payload = {
"APIKey": key,
"url": "",
"email": ""
}
# used for image
files = {"image": image}
response = requests.post(url, data=payload, files=files)
print(response.status_code)
print(response.text)