Quick Start

Good to know: Please read everything thoroughly

Get your CDN keys

https://cdn.numachi.org/dashboard

Libraries

Frontend JS package

<script src="https://cdn.numachi.org/nd/core.js"></script>
<script>const cdn = new NNDC("PUB_KEY");</script>

API Requests

To make your first request, send an authenticated request to the pets endpoint. This will create a pet, which is nice.

Get instance data

GET https://cdn.numachi.org/api/v1/instance

Gets instance data

Headers

Name
Type
Description

Realm*

String

REALM_ID

Authorization

String

AUTH_TOKEN

{
	"code": 200,
	"msg": "OK",
	"json": {
		"instance": {
			"id": "BBl2RMha8228LsUGRCZ1mG7j5xRWfSgSfJ2NXyjFi2g7YT2XahxeU2",
			"prefix": "DEV",
			"workspace": "DEV",
			"active": true,
			"disabled": false,
			"mb": {
				"used": 1.5565609999999999,
				"limit": 3072
			},
			"allowed_types": [
				"gif",
				"jpg",
				"jpeg",
				"png",
				"webp",
				"svg",
				"mp4",
				"webm",
				"mp3",
				"zip"
			],
			"path": "/DEV/"
		},
		"uploads": 0
	}
}

Upload a file

POST https://cdn.numachi.org/api/v1/upload

This can be done in two ways

Query Parameters

Name
Type
Description

max_size*

Number

The max size for each file in bytes

pub_key

String

Only required when doing client side

public

String

Turn to 'true' when using client side uploading

Headers

Name
Type
Description

Content-Type*

String

multipart/form-data

Realm

String

Only required when doing server side

Authorization

String

Only required when doing server side

{
    path: 'https://ndc.numachi.live/WORKSPACE/', 
    files: ['file.png']
}

[DEPRECATED] Upload a base64 string

POST https://cdn.numachi.org/api/v1/upload-base64

Query Parameters

Name
Type
Description

max_size*

Number

25206700 (Max size in bytes)

Headers

Name
Type
Description

Realm*

String

REALM_ID

Authorization*

String

AUTH_TOKEN

Content-Type*

String

application/json

Request Body

Name
Type
Description

base64*

String

Your base64 data

{
	"code": 200,
	"msg": "Success",
	"json": {
		"files": [
			"DEVYqVD9FoQGrl2YGlk2mhTqtTvTzdH72.png"
		],
		"path": "http://localhost:3000/DEV/DEVYqVD9FoQGrl2YGlk2mhTqtTvTzdH72.png"
	}
}

Delete file(s)

DELETE https://cdn.numachi.org/api/v1/:WORKSPACE/files

Delete a file or more

Path Parameters

Name
Type
Description

:WORKSPACE*

String

Workspace name

Headers

Name
Type
Description

Authorization*

String

AUTH_TOKEN

Realm*

String

REALM_ID

Content-Type*

String

application/json

Request Body

Name
Type
Description

files*

Array

File IDs

{
    // Response
}

Last updated