Generate image from FabricJS canvas
curl --request POST \
--url https://api.pictify.io/image/canvas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fabricJSData": {},
"variables": {},
"variableDefinitions": [
{
"name": "<string>",
"defaultValue": "<string>",
"description": "<string>",
"validation": {
"required": true,
"minLength": 123,
"maxLength": 123
}
}
],
"width": 123,
"height": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fabricJSData: {},
variables: {},
variableDefinitions: [
{
name: '<string>',
defaultValue: '<string>',
description: '<string>',
validation: {required: true, minLength: 123, maxLength: 123}
}
],
width: 123,
height: 123
})
};
fetch('https://api.pictify.io/image/canvas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/image/canvas"
payload = {
"fabricJSData": {},
"variables": {},
"variableDefinitions": [
{
"name": "<string>",
"defaultValue": "<string>",
"description": "<string>",
"validation": {
"required": True,
"minLength": 123,
"maxLength": 123
}
}
],
"width": 123,
"height": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/image/canvas"
payload := strings.NewReader("{\n \"fabricJSData\": {},\n \"variables\": {},\n \"variableDefinitions\": [\n {\n \"name\": \"<string>\",\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"validation\": {\n \"required\": true,\n \"minLength\": 123,\n \"maxLength\": 123\n }\n }\n ],\n \"width\": 123,\n \"height\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/image/canvas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fabricJSData\": {},\n \"variables\": {},\n \"variableDefinitions\": [\n {\n \"name\": \"<string>\",\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"validation\": {\n \"required\": true,\n \"minLength\": 123,\n \"maxLength\": 123\n }\n }\n ],\n \"width\": 123,\n \"height\": 123\n}"
response = http.request(request)
puts response.read_body{
"url": "https://cdn.pictify.io/renders/abc123.png",
"userStorageUrl": "<string>",
"id": "img_abc123",
"createdAt": "2023-11-07T05:31:56Z"
}Images
Create Canvas Image
Render an image from FabricJS canvas data
POST
/
image
/
canvas
Generate image from FabricJS canvas
curl --request POST \
--url https://api.pictify.io/image/canvas \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fabricJSData": {},
"variables": {},
"variableDefinitions": [
{
"name": "<string>",
"defaultValue": "<string>",
"description": "<string>",
"validation": {
"required": true,
"minLength": 123,
"maxLength": 123
}
}
],
"width": 123,
"height": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fabricJSData: {},
variables: {},
variableDefinitions: [
{
name: '<string>',
defaultValue: '<string>',
description: '<string>',
validation: {required: true, minLength: 123, maxLength: 123}
}
],
width: 123,
height: 123
})
};
fetch('https://api.pictify.io/image/canvas', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pictify.io/image/canvas"
payload = {
"fabricJSData": {},
"variables": {},
"variableDefinitions": [
{
"name": "<string>",
"defaultValue": "<string>",
"description": "<string>",
"validation": {
"required": True,
"minLength": 123,
"maxLength": 123
}
}
],
"width": 123,
"height": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pictify.io/image/canvas"
payload := strings.NewReader("{\n \"fabricJSData\": {},\n \"variables\": {},\n \"variableDefinitions\": [\n {\n \"name\": \"<string>\",\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"validation\": {\n \"required\": true,\n \"minLength\": 123,\n \"maxLength\": 123\n }\n }\n ],\n \"width\": 123,\n \"height\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://api.pictify.io/image/canvas")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"fabricJSData\": {},\n \"variables\": {},\n \"variableDefinitions\": [\n {\n \"name\": \"<string>\",\n \"defaultValue\": \"<string>\",\n \"description\": \"<string>\",\n \"validation\": {\n \"required\": true,\n \"minLength\": 123,\n \"maxLength\": 123\n }\n }\n ],\n \"width\": 123,\n \"height\": 123\n}"
response = http.request(request)
puts response.read_body{
"url": "https://cdn.pictify.io/renders/abc123.png",
"userStorageUrl": "<string>",
"id": "img_abc123",
"createdAt": "2023-11-07T05:31:56Z"
}Authorizations
API key obtained from the Pictify dashboard
Body
application/json
Response
200 - application/json
Canvas image generated
⌘I