This package provides a Go interface for the Typeform API.

typeform

This package provides a Go interface for the Typeform API.

Installation

go get github.com/roopeshvs/typeform

Getting Started

The first thing is to request an API key from Typeform here. Once you have it, you can create a client to use Typeform programatically.

c := tf.TypeformClient(os.Getenv("TYPEFORM_TOKEN"))

Export the API key as an environment variable and use it to create the client.

Usage

Here are a few examples demonstrating how to create and access resources and data on Typeform.

Create a Form

package main

import (
	"fmt"
	"os"

	tf "github.com/roopeshvs/typeform"
)

func main() {
	c := tf.TypeformClient(os.Getenv("TYPEFORM_TOKEN"))
	newForm := tf.Form{
		Title: "Sample Form",
		Type:  "quiz",
	}
	form, err := c.CreateForm(newForm)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(form.Title)
}

Create an Image

func main() {
	c := tf.TypeformClient(os.Getenv("TYPEFORM_TOKEN"))
	image := tf.CreateImageRequestBody{
		FileName: "pattern.png",
		Image:    "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAACaUlEQVR42uzVMRGAAAzAwLSHf8tgAAf95QVkyVNvNRN50FWBl10V6ABa0AFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIB6ADqEAHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdAA6gBZ0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIBSAcgHYB0ANIB6AAq0AFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgHQA0gFIByAdgA6gAh2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADSAUgHIB2AdADyxy8AAP//YSoDD5pLB7MAAAAASUVORK5CYII=",
	}
	i, err := c.CreateImage(image)
    if err != nil {
        fmt.Println(err)
    }
    fmt.Println(i.Src)
}

Create a Theme

", Layout: "fullscreen", }, Colors: &tf.Colors{ Answer: "#0142AC", Background: "#FFFFFF", Button: "#0142AC", Question: "#000000", }, } t, err := c.CreateTheme(theme) if err != nil { fmt.Println(err) } fmt.Println(t.Name) } ">
func main() {
	c := tf.TypeformClient(os.Getenv("TYPEFORM_TOKEN"))
	theme := tf.Theme{
		Name: "Go Theme Go",
		Font: "Bangers",
		Background: &tf.Background{
			Brightness: -1,
			Href:       "
   
    "
   ,
			Layout:     "fullscreen",
		},
		Colors: &tf.Colors{
			Answer:     "#0142AC",
			Background: "#FFFFFF",
			Button:     "#0142AC",
			Question:   "#000000",
		},
	}
	t, err := c.CreateTheme(theme)
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(t.Name)
}

Contribution

Feel free to create a Github Issue regarding any bugs, feature request, or request to include an API method not supported by this package. Also, you are more than welcome to submit a pull request for the same.

Owner
Roopesh V S
Grok Everything.
Roopesh V S
Similar Resources

GO - Asterisk AMI Interface

GAMI GO - Asterisk AMI Interface communicate with the Asterisk AMI, Actions and Events. Example connecting to Asterisk and Send Action get Events. pac

Sep 27, 2022

NKN-ESI (or nESI) is an NKN based Energy Services Interface (ESI).

nkn-esi NKN-ESI (or nESI) is an NKN based Energy Services Interface (ESI). An ESI supports a distributed marketplace for energy services on the electr

Mar 18, 2022

Go library to interface with Solana JSON RPC and WebSocket interfaces

Go library to interface with Solana JSON RPC and WebSocket interfaces

Solana SDK library for Go Go library to interface with Solana JSON RPC and WebSocket interfaces. Clients for Solana native programs, Solana Program Li

Mar 2, 2022

Command line interface to windows clipboard over KiTTY remote-control printing

kclip Command line interface to windows clipboard over KiTTY remote-control printing About This tool behaves like the cat command, it just tries to pa

Dec 12, 2021

gRPC Network Management Interface

gNMI - gRPC Network Management Interface This repository contains reference Go implementations for gNMI. Note: This is not an official Google product.

Jan 8, 2023

Invidtui - An invidious client, which fetches data from invidious and displays a user interface in the terminal(TUI)

Invidtui - An invidious client, which fetches data from invidious and displays a user interface in the terminal(TUI)

invidtui invidtui is an invidious client, which fetches data from invidious and

Dec 27, 2022

The MinIO Admin Go Client SDK provides APIs to manage MinIO services

Golang Admin Client API Reference The MinIO Admin Golang Client SDK provides APIs to manage MinIO services. This quickstart guide will show you how to

Dec 30, 2022

koanfenv provides koanf callbacks that translate environment variables to koanf keys.

koanfenv koanfenv provides callbacks which convert environment variables to koanf keys. These callbacks are used for env.Provider . Usage config := st

Dec 12, 2021

It provides features that standardize some Windows and Linux commands.

It provides features that standardize some Windows and Linux commands.

lingue It provides features that standardize some Windows and Linux commands. The cmd cleanup command implementation is available in the package. From

Dec 24, 2021
Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers

go-whatsapp Package rhymen/go-whatsapp implements the WhatsApp Web API to provide a clean interface for developers. Big thanks to all contributors of

Mar 19, 2022
go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

Dec 15, 2022
Package captcha is a middleware that provides captcha service for Flamego

auth Package captcha is a middleware that provides captcha service for Flamego. Installation The minimum requirement of Go is 1.16. go get github.com/

Dec 14, 2022
Package anko provides a golang SDK to the Anko Investor Forecasts gRPC service.

github.com/anglo-korean/anko-go-sdk Package anko provides a golang SDK to the Anko Investor Forecasts gRPC service. import "github.com/anglo-korean/an

Jan 3, 2022
Package figtree provides a multi-paradigm SDK for sophisticated configuration file access

Package figtree provides a multi-paradigm SDK for sophisticated configuration file access. Motivation Figtree syntax is based on classic key/value pai

Dec 31, 2021
It is a package and command line application that provides you to store encrypted credentials/secrets in your repository.

sypher[ ⚠️ Work in progress] sypher provides you to store your credentials and secrets as encrypted in your repository. Usage Install the command line

Feb 23, 2022
Elastos.ELA.Rosetta.API - How to write a Rosetta server and use either the Client package or Fetcher package to communicate

Examples This folder demonstrates how to write a Rosetta server and how to use e

Jan 17, 2022
🎼 This library provides an API to search for lyrics from various providers in China.

LYRIC-GO This library provides an API to search for lyrics from various providers in China. Supported Providers KuGou Music QQ Music Netease Music Usa

May 24, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
Go package providing opinionated tools and methods for working with the `aws-sdk-go/service/cloudfront` package.

go-aws-cloudfront Go package providing opinionated tools and methods for working with the aws-sdk-go/service/cloudfront package. Documentation Tools $

Feb 2, 2022