Request cURL
curl -s -X POST "https://app.upfour.io/v1/status-pages/feed-preview" \
-H "Authorization: Bearer $UP4_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com"
}'
JavaScript
const res = await fetch("https://app.upfour.io/v1/status-pages/feed-preview", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.UP4_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://example.com",
}),
});
console.log(res.status, await res.json());
Python
import os
import requests
res = requests.post(
"https://app.upfour.io/v1/status-pages/feed-preview",
headers={"Authorization": f"Bearer {os.environ['UP4_API_KEY']}"},
json={
"url": "https://example.com",
},
)
print(res.status_code, res.json())
Go
package main
import (
"fmt"
"io"
"net/http"
"os"
"strings"
)
func main() {
payload := strings.NewReader(`{
"url": "https://example.com"
}`)
req, _ := http.NewRequest("POST", "https://app.upfour.io/v1/status-pages/feed-preview", payload)
req.Header.Set("Authorization", "Bearer "+os.Getenv("UP4_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
fmt.Println(res.StatusCode, string(out))
}
PHP
<?php
$payload = <<<'JSON'
{
"url": "https://example.com"
}
JSON;
$ch = curl_init("https://app.upfour.io/v1/status-pages/feed-preview");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("UP4_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), " ", $response, "\n";
curl_close($ch);
Response
200
{
"data": {
"components": [
{
"group": "example",
"id": "3f6c1a52-8b1e-4f0d-9a43-2c5d7e8f1a90",
"name": "Example",
"status": "example"
}
],
"format": "statuspage_v2",
"page_name": "example",
"url": "https://example.com"
}
}
400
{
"error": {
"code": "bad_request",
"message": "The request is malformed or fails validation.",
"request_id": "req_…"
}
}
403
{
"error": {
"code": "permission_denied",
"message": "The credentials do not permit this action.",
"request_id": "req_…"
}
}