Get Template Schema

Fetch a template's JSON Schema.

HTTP Request

GET https://app.formapi.io/api/v1/templates/<TEMPLATE_ID>/schema

Authentication

You must send an Authorization header with the value Basic followed by base 64 encoded token_id:token_secret.

For example: Authorization: Basic dG9rZW5faWQ6dG9rZW5fc2VjcmV0Cg==

See the Authentication documentation for more information.

Example Code

var FormAPI = require("@formapi/formapi");

var config = new FormAPI.Configuration();
config.apiTokenId = "FORMAPI_TOKEN_ID";
config.apiTokenSecret = "FORMAPI_TOKEN_SECRET";
client = new FormAPI.Client(config);

client.getTemplateSchema("YOUR_TEMPLATE_ID", function(error, schema) {
  if (error) throw error;
  console.log(schema);
});
using System;
using System.Diagnostics;
using FormApi.Client.Api;
using FormApi.Client.Client;
using FormApi.Client.Model;

namespace Example
{
    public class FormAPIExample
    {
        public void main()
        {
          Configuration.Default.Username = "FORMAPI_TOKEN_ID";
          Configuration.Default.Password = "FORMAPI_TOKEN_SECRET";

          var apiInstance = new PDFApi();
          string templateId = "tpl_000000000000000001";
          var schema = apiInstance.GetTemplateSchema(templateId);

          // schema is Dictionary<string, Object>
          // schema["properties"] is Newtonsoft.Json.Linq.JObject
          var properties = schema["properties"] as Newtonsoft.Json.Linq.JObject;
          Debug.WriteLine(properties);
        }
    }
}

results matching ""

    No results matching ""