Skip to content

Latest commit

 

History

History
53 lines (48 loc) · 1.73 KB

do-it-yourself.mdx

File metadata and controls

53 lines (48 loc) · 1.73 KB

import { Tabs, Tab } from "nextra-theme-docs";

Do It Yourself

Interweave doesn't require JavaScript or the npm package to function. You can make a regular HTTP request to the Interweave API to build your interface with JSON.

Here is a basic example script to do that:

<Tabs items={["Curl", "JS Fetch"]}> bash curl -X POST "https://api.interwv.com/api/v1/projects/__YOUR_PROJECT_ID__/interfaces" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer __YOUR_PROJECT_API_TOKEN__" \ -d '{ "schema_config": SCHEMA, "key": KEY, "title": TITLE, "description": DESCRIPTION }' js try { // Request to API const res = await fetch( `https://api.interwv.com/api/v1/projects/__YOUR_PROJECT_ID__/interfaces`, { method: "POST", body: JSON.stringify({ // Schema information schema_config: schema, // Note that key, title, and description are separate here key: schema.key, title: schema.title, description: schema.description }), headers: { "Content-Type": "application/json", authorization: `Bearer __YOUR_PROJECT_API_TOKEN__` } } ); const data = await res.json(); console.log(`Update responded with a status of ${data.http_status}.`); } catch (err) { console.log(err); }