- Base URL: https://editor.p5js.org/
- Only the success responses are mentioned below. For each of the following, in case of an error, an error message will be present in the response, in the format
{ "message": "error message" }
- For Authenticating the requests, a cookie is required which can be obtained from the Login endpoint.
- Auth: None
- Body:
{ "email": "p5 email or username", "password": "p5 password" }
- Response:
- 200 -
UserInfo
Object
- 200 -
In this request, save the value of the set-cookie
response header for further requests. In all authenticated requests, the Cookie
header must be filled with this value.
- Auth - REQUIRED
- Response:
- 200 -
UserInfo
Object
- 200 -
- Auth - None
- Response:
- 200 - [
SketchInfo
]
- 200 - [
- Auth - None
- Response:
- 200 -
SketchInfo
- 200 -
- Auth - REQUIRED
- Body:
{ "files": [SketchFile], "id": "sketchId", "isSaving": false, "owner": SketchOwner, "updatedAt": DateTime }
- Response:
- 200 -
SketchInfo
- 200 -
{
"email": "email",
"username": "username",
"preferences": {
"fontSize": number,
"lineNumbers": bool,
"indentationAmount": number,
"isTabIndent": bool,
"autosave": bool,
"linewrap": bool,
"lintWarning": bool,
"textOutput": bool,
"gridOutput": bool,
"theme": string,
"autorefresh": bool,
"language": string,
"autocloseBracketsQuotes": bool,
"soundOutput": bool
},
"apiKeys": [],
"verified": "verified",
"id": string,
"totalSize": number,
"cookieConsent": string
}
{
"name": "Sketch Name",
"serveSecure": bool,
"_id": string,
"user": SketchOwner,
"updatedAt": DateTime,
"files": [SketchFile],
"createdAt": DateTime,
"slug": string,
"__v": 0,
"id": string
}
{
"_id": string,
"username": string,
"id": string
}
{
"name": "filename/foldername",
"content": "file contents",
"children": [], // array of file ids present in this folder
"fileType": "file" | "folder",
"_id": string,
"createdAt": DateTime,
"updatedAt": DateTime,
"id": string
}