Skip to content

Instantly share code, notes, and snippets.

View DaltonWebDev's full-sized avatar
🏠
Working from home

Dalton Edwards DaltonWebDev

🏠
Working from home
View GitHub Profile

Henlo API

All Henlo functionality is available using our open API. Henlo.XYZ uses all the same APIs that developers have access to. We encourage developers to make their own Henlo clients. Below I'm going to outline all available APIs and how to interact with them. Keep in mind that Henlo is in beta and API changes and downtime might happen at times.

This gist will be updated whenever there's an API update, so don't forget to bookmark this page.

Authentication

The authentication endpoint is used for logins and registrations. The API URL is:

https://henlo.xyz/api/auth.php

Intro

Simple Site is a service for sharing code/hosting single-page static web applications.

Create Site

API Endpoint: https://ss.dewdd.com/api.php [POST]

Parameters: action, code

action = create

These API docs are outdated. 1MB is launching a new API soon :)

Create Link

Method: POST

Parameters

url – the place you want your link to redirect to (must include http:// or https://)

link – *( optional parameter) * Must be alphanumeric and can't exceed 20 characters in length. If you don't set this a link will be randomly generated.

Output

error will be false upon success. otherwise it will output a string for example "URL_MISSING".. they are all self explanatory

function sendEmail($to, $subject, $from, $content) {
$data = "{\"personalizations\": [ { \"to\": [ { \"email\": \"$to\" } ], \"subject\": \"$subject\" } ], \"from\": { \"email\": \"$from\" }, \"content\": [ { \"type\": \"text/plain\", \"value\": \"$content\" } ] }";
$result = file_get_contents("https://api.sendgrid.com/v3/mail/send", null, stream_context_create(array(
"http" => array(
"method" => "POST",
"header" => "Content-Type: application/json" . "\r\n"
. "Content-Length: " . strlen($data) . "\r\n" . "Authorization: Bearer RETRACTED",
"content" => $data
)
)));
<?php
session_start();
header("Content-type: application/json; charset=utf-8");
$username = !empty($_POST["username"]) ? strtolower($_POST["username"]) : false;
$message = !empty($_POST["message"]) ? $_POST["message"] : false;
$sticky = false;
if ($username === false) {
$botMessage = "Who are you?";
} else if ($message === false) {
$botMessage = "Please write something before hitting send.";
<?php
header("Content-type: application/json; charset=utf-8");
$username = !empty($_POST["username"]) ? strtolower($_POST["username"]) : false;
$message = !empty($_POST["message"]) ? $_POST["message"] : false;
$messageExploded = explode(" ", $message);
if ($messageExploded[0] === "text") {
$outputArray[] = [
"type" => "text",
"message" => "Your username is " . $username
];
<!DOCTYPE html>
<html>
<head></head>
<body>
<form action="https://link.to.your.form/" id="wehatecaptchas">
<!— more inputs here —>
<button type="submit" difficulty="5">Submit</button>
</form>
<script>
const onSubmit = (data) => {