API Examples


Java Script
PHP
C#
//get your forms via API

var request = require('request');

var options = {
  url: 'https://YourTitanSubDomain.formtitan.com/api/v1/forms',
  headers: {
    'ftAPIKey': 'your-key'
    }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
  }
}

request.get(options, callback);
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://YourTitanSubDomain.formtitan.com/api/v1/forms');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('ftAPIKey:'.'your-key'));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($ch);
curl_close($ch);
$info = json_decode($result, true);
print_r($result);
?>
string html = string.Empty;
string url = @"https://YourTitanSubDomain.formtitan.com/api/v1/forms";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

//Get the headers associated with the request.
WebHeaderCollection myWebHeaderCollection = myHttpWebRequest.Headers;

//Add the Accept-Language header (for Danish) in the request.
myWebHeaderCollection.Add("ftAPIKey:your-key");

using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(stream))
{
html = reader.ReadToEnd();
}

Console.WriteLine(html);