Templates

List available templates

List templates

GET https://api.usestencil.com/v1/projects/:project_id/templates

Path Parameters

NameTypeDescription

project_id

string

Project ID

Query Parameters

NameTypeDescription

before

string

Query the previous result set

after

string

Query the next result set

{
  "meta":{
    "next":null,
    "previous":null,
    "total_count":2
  },
  "results":[
    {
      "available_modifications":[
        [
          {
            "description":"URL of the image",
            "field":"src",
            "primary":true,
            "required":true,
            "type":"string",
            "value":"https//example.com/image.png"
          },
          {
            "description":"Object identifier",
            "field":"name",
            "primary":false,
            "required":true,
            "type":"string",
            "value":"image_3"
          },
          {
            "description":"Angle of the object",
            "field":"angle",
            "primary":false,
            "required":false,
            "type":"integer",
            "value":0
          }
        ],
        [
          {
            "description":"Value for the textbox",
            "field":"text",
            "primary":true,
            "required":true,
            "type":"string",
            "value":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do..."
          },
          {
            "description":"Text color",
            "field":"fill",
            "primary":false,
            "required":false,
            "type":"string",
            "value":"rgba(15, 15, 15, 1)"
          },
          {
            "description":"Object identifier",
            "field":"name",
            "primary":false,
            "required":true,
            "type":"string",
            "value":"circular_text_2"
          },
          {
            "description":"Angle of the object",
            "field":"angle",
            "primary":false,
            "required":false,
            "type":"integer",
            "value":0
          }
        ],
        [
          {
            "description":"Value for the textbox",
            "field":"text",
            "primary":true,
            "required":true,
            "type":"string",
            "value":"ينا الألم. في بعض الأحيان ونظراً للالتزامات التي يفرضها علينا الواجب والعمل سنتنازل غالباً ونرفض الشعور"
          },
          {
            "description":"Text color",
            "field":"fill",
            "primary":false,
            "required":false,
            "type":"string",
            "value":"rgba(0, 0, 0, 1)"
          },
          {
            "description":"Object identifier",
            "field":"name",
            "primary":false,
            "required":true,
            "type":"string",
            "value":"text_5"
          },
          {
            "description":"Angle of the object",
            "field":"angle",
            "primary":false,
            "required":false,
            "type":"integer",
            "value":0
          }
        ]
      ],
      "created_at":"2021-05-22T05:00:44Z",
      "id":"10dee897-cc28-4ae1-bf8e-f1bc1c551fe3",
      "name":"Test2",
      "project_id":"f2eb2dab-a861-4960-b5f4-d54c61552f7d",
      "self":"http://localhost:4000/api/v1/templates/10dee897-cc28-4ae1-bf8e-f1bc1c551fe3",
      "signed_image_base":"Hts6NWUuvtXbmGaQbM2kGM",
      "starred":false,
      "updated_at":"2021-05-22T05:00:59Z"
    },
    {
      "available_modifications":[
        [
          {
            "description":"URL of the image",
            "field":"src",
            "primary":true,
            "required":true,
            "type":"string",
            "value":"https//example.com/image.png"
          },
          {
            "description":"Object identifier",
            "field":"name",
            "primary":false,
            "required":true,
            "type":"string",
            "value":"image_3"
          },
          {
            "description":"Angle of the object",
            "field":"angle",
            "primary":false,
            "required":false,
            "type":"integer",
            "value":0
          }
        ],
        [
          {
            "description":"Value for the textbox",
            "field":"text",
            "primary":true,
            "required":true,
            "type":"string",
            "value":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do..."
          },
          {
            "description":"Text color",
            "field":"fill",
            "primary":false,
            "required":false,
            "type":"string",
            "value":"rgba(15, 15, 15, 1)"
          },
          {
            "description":"Object identifier",
            "field":"name",
            "primary":false,
            "required":true,
            "type":"string",
            "value":"circular_text_2"
          },
          {
            "description":"Angle of the object",
            "field":"angle",
            "primary":false,
            "required":false,
            "type":"integer",
            "value":0
          }
        ],
        [
          {
            "description":"Value for the textbox",
            "field":"text",
            "primary":true,
            "required":true,
            "type":"string",
            "value":"ينا الألم. في بعض الأحيان ونظراً للالتزامات التي يفرضها علينا الواجب والعمل سنتنازل غالباً ونرفض الشعور"
          },
          {
            "description":"Text color",
            "field":"fill",
            "primary":false,
            "required":false,
            "type":"string",
            "value":"rgba(0, 0, 0, 1)"
          },
          {
            "description":"Object identifier",
            "field":"name",
            "primary":false,
            "required":true,
            "type":"string",
            "value":"text_5"
          },
          {
            "description":"Angle of the object",
            "field":"angle",
            "primary":false,
            "required":false,
            "type":"integer",
            "value":0
          }
        ]
      ],
      "created_at":"2021-05-22T04:59:03Z",
      "id":"70176253-3bcb-4592-913d-a6c5df83a258",
      "name":"Untitled",
      "project_id":"f2eb2dab-a861-4960-b5f4-d54c61552f7d",
      "self":"http://localhost:4000/api/v1/templates/70176253-3bcb-4592-913d-a6c5df83a258",
      "signed_image_base":"Hts6NWUuvtXbmGaQbM2kGM",
      "starred":true,
      "updated_at":"2021-05-22T07:43:02Z"
    }
  ]
}

after and before are related to pagination. Please see pagination page for more information

Get specific template

GET https://api.usestencil.com/v1/templates/:id

Path Parameters

NameTypeDescription

id

string

Template ID

Query Parameters

NameTypeDescription

before

string

Query the previous result set

after

string

Query the next result set

{
  "available_modifications":[
    [
      {
        "description":"URL of the image",
        "field":"src",
        "primary":true,
        "required":true,
        "type":"string",
        "value":"https://example.com/image.png"
      },
      {
        "description":"Object identifier",
        "field":"name",
        "primary":false,
        "required":true,
        "type":"string",
        "value":"image_3"
      },
      {
        "description":"Angle of the object",
        "field":"angle",
        "primary":false,
        "required":false,
        "type":"integer",
        "value":0
      }
    ],
    [
      {
        "description":"Value for the textbox",
        "field":"text",
        "primary":true,
        "required":true,
        "type":"string",
        "value":"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do..."
      },
      {
        "description":"Text color",
        "field":"fill",
        "primary":false,
        "required":false,
        "type":"string",
        "value":"rgba(15, 15, 15, 1)"
      },
      {
        "description":"Object identifier",
        "field":"name",
        "primary":false,
        "required":true,
        "type":"string",
        "value":"circular_text_2"
      },
      {
        "description":"Angle of the object",
        "field":"angle",
        "primary":false,
        "required":false,
        "type":"integer",
        "value":0
      }
    ],
    [
      {
        "description":"Value for the textbox",
        "field":"text",
        "primary":true,
        "required":true,
        "type":"string",
        "value":"ينا الألم. في بعض الأحيان ونظراً للالتزامات التي يفرضها علينا الواجب والعمل سنتنازل غالباً ونرفض الشعور"
      },
      {
        "description":"Text color",
        "field":"fill",
        "primary":false,
        "required":false,
        "type":"string",
        "value":"rgba(0, 0, 0, 1)"
      },
      {
        "description":"Object identifier",
        "field":"name",
        "primary":false,
        "required":true,
        "type":"string",
        "value":"text_5"
      },
      {
        "description":"Angle of the object",
        "field":"angle",
        "primary":false,
        "required":false,
        "type":"integer",
        "value":0
      }
    ]
  ],
  "created_at":"2021-05-22T05:00:44Z",
  "id":"10dee897-cc28-4ae1-bf8e-f1bc1c551fe3",
  "name":"Test2",
  "project_id":"f2eb2dab-a861-4960-b5f4-d54c61552f7d",
  "self":"http://localhost:4000/api/v1/templates/10dee897-cc28-4ae1-bf8e-f1bc1c551fe3",
  "signed_image_base":"Hts6NWUuvtXbmGaQbM2kGM",
  "starred":false,
  "updated_at":"2021-05-22T05:00:59Z"
}

Response

available_modification object

Property

Description

description

Description of the property

field

Field unique identifier

value

Value of the field

required

Indicate that the value must be specified

type

The type of value i.e. Integer requires number to be specified

signed_image_base

Base ID for secure signed image. See Secure Signed Image for more information.

The rests of the fields are self explanatory.

Last updated