API Documentation

WP URL Shortener API Documentation

Base URL

https://online.dnnengineer.com/wp-json/url-shortener/v1

Authentication

Use your API key in request headers:

X-API-KEY: <your_api_key>

Create Short URL

  • cURL
  • Python
  • JavaScript (fetch)
curl -X POST https://online.dnnengineer.com/wp-json/url-shortener/v1/create \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{"url":"https://example.com","custom":"my-short-link"}'
import requests

url = "https://online.dnnengineer.com/wp-json/url-shortener/v1/create"
headers = {
    "Content-Type": "application/json",
    "X-API-KEY": "YOUR_API_KEY"
}
data = {"url":"https://example.com","custom":"my-short-link"}

response = requests.post(url, json=data, headers=headers)
print(response.json())
fetch("https://online.dnnengineer.com/wp-json/url-shortener/v1/create", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-API-KEY": "YOUR_API_KEY"
  },
  body: JSON.stringify({url:"https://example.com", custom:"my-short-link"})
})
.then(response => response.json())
.then(data => console.log(data));

Get Analytics

  • cURL
  • Python
  • JavaScript (fetch)
curl -X GET https://online.dnnengineer.com/wp-json/url-shortener/v1/analytics/my-short-link \
-H "X-API-KEY: YOUR_API_KEY"
import requests

url = "https://online.dnnengineer.com/wp-json/url-shortener/v1/analytics/my-short-link"
headers = {"X-API-KEY": "YOUR_API_KEY"}

response = requests.get(url, headers=headers)
print(response.json())
fetch("https://online.dnnengineer.com/wp-json/url-shortener/v1/analytics/my-short-link", {
  headers: {"X-API-KEY": "YOUR_API_KEY"}
})
.then(response => response.json())
.then(data => console.log(data));
Scroll to Top