Skip to main content

SDKs and tools

OpenAPI spec

The full machine-readable spec is at:

https://api.userevaluation.com/v1/openapi.json

Drop it into:

  • Postman — File → Import → URL
  • Insomnia — Create → From URL
  • Stoplight Studio — Open the URL directly
  • Any code generator that supports OpenAPI 3.1 (openapi-generator, openapi-typescript, oazapfts, etc.)

Hand-rolled clients

For most integrations a thin wrapper over fetch / requests is plenty. The API is small enough that pinning a dependency for a generated SDK is rarely worth it.

TypeScript

const UE = (token: string) => async <T>(
path: string,
init?: RequestInit
): Promise<T> => {
const r = await fetch(`https://api.userevaluation.com/v1${path}`, {
...init,
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
...init?.headers
}
});
const body = await r.json();
if (!r.ok) throw Object.assign(new Error(body.error?.message || r.statusText), {
status: r.status,
code: body.error?.code,
details: body.error?.details
});
return body.data;
};

const ue = UE(process.env.UE_API_KEY!);

const me = await ue("/me");
const projects = await ue<{ id: string; name: string }[]>("/projects");

Python

import os, requests

class UEError(Exception):
def __init__(self, code, message, details=None, status=None):
self.code, self.message, self.details, self.status = code, message, details, status
super().__init__(message)

class UE:
def __init__(self, token):
self.s = requests.Session()
self.s.headers["Authorization"] = f"Bearer {token}"

def request(self, method, path, **kw):
r = self.s.request(method, f"https://api.userevaluation.com/v1{path}", **kw)
body = r.json()
if not r.ok:
err = body.get("error", {})
raise UEError(err.get("code"), err.get("message"), err.get("details"), r.status_code)
return body["data"]

def get(self, path, **kw): return self.request("GET", path, **kw)
def post(self, path, json=None, **kw): return self.request("POST", path, json=json, **kw)
# ...

ue = UE(os.environ["UE_API_KEY"])
print(ue.get("/me"))

Coming later

We're considering generated SDKs for TypeScript and Python. If that would help your project, tell us — knowing demand is here will move it up the queue.